Skip to content

Guardian 5.46.0 ​

class · pocketmine\entity\monster\Guardian · source

Extends AquaticMonster

Bedrock values (guardian.json): 30 health, 0.85x0.85, swims (movement 0.12), follow range 16, attack 5. Targets players and squids it can see within 16 blocks and fires its laser at them (see GuardianAttackGoal): the beam deals 1 magic damage (+2 on hard, +2 for elder guardians) plus its attack damage. Melee attackers take 2 thorns damage from its spikes while it is not moving. Loot: 0-2 prismarine shards (+0-1 per Looting level); raw cod (2/5) or prismarine crystals (2/5) (+0-1 per Looting level); 2.5% (+1% per Looting level) a fish when killed by a player. Experience 10.

Constants ​

ATTACK_DAMAGE ​

php
public const ATTACK_DAMAGE = 5.0

ATTACK_DURATION ​

php
public const ATTACK_DURATION = 80

FOLLOW_RANGE ​

php
public const FOLLOW_RANGE = 16.0

Methods ​

attack() ​

php
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : void

fireBeam() ​

php
public function fireBeam(\pocketmine\entity\Living $target) : void

Fires the charged laser at the target.

getAttackDuration() ​

php
public function getAttackDuration() : int

Ticks the laser takes to charge once warmed up.

getBeamMagicDamage() ​

php
public function getBeamMagicDamage() : float

Returns the magic damage part of the laser: 1, +2 on hard, +2 for elder guardians (Java GuardianAttackGoal).

getBeamTarget() ​

php
public function getBeamTarget() : ?\pocketmine\entity\Living

getDrops() ​

php
public function getDrops() : array

getFollowRange() ​

php
public function getFollowRange() : float

getInitialSizeInfo() protected ​

php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfo

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getPickedItem() ​

php
public function getPickedItem() : ?\pocketmine\item\Item

getSwimSpeed() protected ​

php
protected function getSwimSpeed() : float

getXpDropAmount() ​

php
public function getXpDropAmount() : int

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

isElder() ​

php
public function isElder() : bool

onBeamCharging() ​

php
public function onBeamCharging() : void

Called when the laser starts charging (after the warm-up): plays the beam sound on the clients.

registerGoals() protected ​

php
protected function registerGoals() : void

setAttackTarget() ​

php
public function setAttackTarget(?\pocketmine\entity\Living $target) : void

setBeamTarget() ​

php
public function setBeamTarget(?\pocketmine\entity\Living $target) : void

Locks the laser on an entity (null: no beam). The client draws the beam to the entity in TARGET_EID.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.