Warden 5.46.0
Extends Monster
Implements VibrationListener
Bedrock values (Mojang bedrock-samples behavior_pack/entities/warden.json): 500 health, movement 0.3, melee 30 (16/30/45 by difficulty), 0.9x2.9, fire immune, no knockback, darkness to players within 20 blocks every 6 s for 13 s, sonic boom 10 damage (ignores armour) with a 3 s animation, emerges in 7 s, digs back in 5.5 s after 60 s without a disturbance, sniffs for 4.16 s every 5-10 s, roars for 4.2 s at a new target, hears vibrations within 16 blocks. Loot: a sculk catalyst (loot_tables/entities/warden.json); 5 XP when killed by a player.
The warden is blind: it finds targets only through anger (WardenAnger) raised by vibrations, by being touched or hurt, and by sniffing out nearby players. Emerging, digging, roaring, sniffing and the sonic boom are animated by the client from the EMERGING, DIGGING, ROARING, SNIFFING and SONIC_BOOM flags (their sounds are part of the client animations; the sonic boom charge and blast sounds are sent by the server).
Constants
ANGER_RANGE
public const ANGER_RANGE = 25Suspects farther than this are forgotten.
DARKNESS_DURATION
public const DARKNESS_DURATION = 260DARKNESS_INTERVAL
public const DARKNESS_INTERVAL = 120DARKNESS_RANGE
public const DARKNESS_RANGE = 20DIG_IDLE_TICKS
public const DIG_IDLE_TICKS = 1200DIG_TICKS
public const DIG_TICKS = 110EMERGE_TICKS
public const EMERGE_TICKS = 140FOLLOW_RANGE
public const FOLLOW_RANGE = 30.0HEARTBEAT_SOUND_ID
public const HEARTBEAT_SOUND_ID = 376LevelSoundEvent numeric ID of "heartbeat" (376 in the numeric enum used until 1.26.20) for the HEARTBEAT_LEVEL_SOUND_EVENT metadata, which is still an int.
LISTEN_RANGE
public const LISTEN_RANGE = 16ROAR_TICKS
public const ROAR_TICKS = 84SNIFF_RANGE
public const SNIFF_RANGE = 24SNIFF_TICKS
public const SNIFF_TICKS = 83SONIC_BOOM_COOLDOWN
public const SONIC_BOOM_COOLDOWN = 40SONIC_BOOM_DAMAGE
public const SONIC_BOOM_DAMAGE = 10.0SONIC_BOOM_HIT_TICK
public const SONIC_BOOM_HIT_TICK = 34Tick of the sonic boom animation at which the blast hits (vanilla Java: 34).
SONIC_BOOM_RANGE_XZ
public const SONIC_BOOM_RANGE_XZ = 15SONIC_BOOM_RANGE_Y
public const SONIC_BOOM_RANGE_Y = 20SONIC_BOOM_TICKS
public const SONIC_BOOM_TICKS = 60STATE_DIGGING
public const STATE_DIGGING = 2STATE_EMERGING
public const STATE_EMERGING = 1STATE_NONE
public const STATE_NONE = 0STATE_ROARING
public const STATE_ROARING = 3STATE_SNIFFING
public const STATE_SNIFFING = 4STATE_SONIC_BOOM
public const STATE_SONIC_BOOM = 5SUSPICION_RANGE_XZ
public const SUSPICION_RANGE_XZ = 6SUSPICION_RANGE_Y
public const SUSPICION_RANGE_Y = 20VIBRATION_COOLDOWN
public const VIBRATION_COOLDOWN = 40Methods
attack()
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : voidattackMelee()
public function attackMelee(\pocketmine\entity\Living $target, float $baseDamage) : boolentityBaseTick() protected
protected function entityBaseTick(int $tickDiff = 1) : boolgetAnger()
public function getAnger() : \pocketmine\entity\monster\WardenAngergetAngerLevel()
public function getAngerLevel() : intgetDrops()
public function getDrops() : arraygetInitialSizeInfo() protected
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetListenerPosition()
public function getListenerPosition() : \pocketmine\math\Vector3getListenerRange()
public function getListenerRange() : intgetName()
public function getName() : stringgetNetworkTypeId()
public static function getNetworkTypeId() : stringgetState()
public function getState() : intgetSuspiciousLocation()
public function getSuspiciousLocation() : ?\pocketmine\math\Vector3increaseAnger()
public function increaseAnger(\pocketmine\entity\Entity $entity, int $amount) : intAdds anger towards the entity (ignored for invalid suspects) and returns the new anger.
initEntity() protected
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisDigging()
public function isDigging() : boolisEmerging()
public function isEmerging() : boolisFireProof()
public function isFireProof() : boolisInSonicBoomRange()
public function isInSonicBoomRange(\pocketmine\entity\Entity $target) : boolisListening()
public function isListening() : boolReturns whether a vibration is travelling to the warden.
isValidSuspect()
public function isValidSuspect(?\pocketmine\entity\Entity $entity) : boolReturns whether the warden may be angry at the entity: living, not a warden, and for players in survival or adventure mode.
onDispose() protected
protected function onDispose() : voidonVibration()
public function onVibration(\pocketmine\math\Vector3 $pos, \pocketmine\world\vibration\GameEvent $event, ?\pocketmine\entity\Entity $source, ?\pocketmine\block\Block $affected, float $distance) : voidplayAmbientSound() protected
protected function playAmbientSound() : voidregisterGoals() protected
protected function registerGoals() : voidsaveNBT()
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetSuspiciousLocation()
public function setSuspiciousLocation(?\pocketmine\math\Vector3 $location) : voidsonicBoom()
public function sonicBoom(\pocketmine\entity\Living $target) : voidThe sonic boom: goes through blocks, ignores armour (magic damage) and knocks the target back (Bedrock knockback_horizontal_strength 2.5, knockback_vertical_strength 0.5, knockback_height_cap 0.5).
startEmerging()
public function startEmerging() : voidPlays the emerging animation (as when summoned by a sculk shrieker): the warden doesn't move or hear anything for 7 seconds.
syncNetworkData() protected
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : voidtickAi() protected
protected function tickAi(int $currentTick) : void