Skip to content

Warden 5.46.0 ​

class · pocketmine\entity\monster\Warden · source

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 ​

php
public const ANGER_RANGE = 25

Suspects farther than this are forgotten.

DARKNESS_DURATION ​

php
public const DARKNESS_DURATION = 260

DARKNESS_INTERVAL ​

php
public const DARKNESS_INTERVAL = 120

DARKNESS_RANGE ​

php
public const DARKNESS_RANGE = 20

DIG_IDLE_TICKS ​

php
public const DIG_IDLE_TICKS = 1200

DIG_TICKS ​

php
public const DIG_TICKS = 110

EMERGE_TICKS ​

php
public const EMERGE_TICKS = 140

FOLLOW_RANGE ​

php
public const FOLLOW_RANGE = 30.0

HEARTBEAT_SOUND_ID ​

php
public const HEARTBEAT_SOUND_ID = 376

LevelSoundEvent 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 ​

php
public const LISTEN_RANGE = 16

ROAR_TICKS ​

php
public const ROAR_TICKS = 84

SNIFF_RANGE ​

php
public const SNIFF_RANGE = 24

SNIFF_TICKS ​

php
public const SNIFF_TICKS = 83

SONIC_BOOM_COOLDOWN ​

php
public const SONIC_BOOM_COOLDOWN = 40

SONIC_BOOM_DAMAGE ​

php
public const SONIC_BOOM_DAMAGE = 10.0

SONIC_BOOM_HIT_TICK ​

php
public const SONIC_BOOM_HIT_TICK = 34

Tick of the sonic boom animation at which the blast hits (vanilla Java: 34).

SONIC_BOOM_RANGE_XZ ​

php
public const SONIC_BOOM_RANGE_XZ = 15

SONIC_BOOM_RANGE_Y ​

php
public const SONIC_BOOM_RANGE_Y = 20

SONIC_BOOM_TICKS ​

php
public const SONIC_BOOM_TICKS = 60

STATE_DIGGING ​

php
public const STATE_DIGGING = 2

STATE_EMERGING ​

php
public const STATE_EMERGING = 1

STATE_NONE ​

php
public const STATE_NONE = 0

STATE_ROARING ​

php
public const STATE_ROARING = 3

STATE_SNIFFING ​

php
public const STATE_SNIFFING = 4

STATE_SONIC_BOOM ​

php
public const STATE_SONIC_BOOM = 5

SUSPICION_RANGE_XZ ​

php
public const SUSPICION_RANGE_XZ = 6

SUSPICION_RANGE_Y ​

php
public const SUSPICION_RANGE_Y = 20

VIBRATION_COOLDOWN ​

php
public const VIBRATION_COOLDOWN = 40

Methods ​

attack() ​

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

attackMelee() ​

php
public function attackMelee(\pocketmine\entity\Living $target, float $baseDamage) : bool

entityBaseTick() protected ​

php
protected function entityBaseTick(int $tickDiff = 1) : bool

getAnger() ​

php
public function getAnger() : \pocketmine\entity\monster\WardenAnger

getAngerLevel() ​

php
public function getAngerLevel() : int

getDrops() ​

php
public function getDrops() : array

getInitialSizeInfo() protected ​

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

getListenerPosition() ​

php
public function getListenerPosition() : \pocketmine\math\Vector3

getListenerRange() ​

php
public function getListenerRange() : int

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getState() ​

php
public function getState() : int

getSuspiciousLocation() ​

php
public function getSuspiciousLocation() : ?\pocketmine\math\Vector3

increaseAnger() ​

php
public function increaseAnger(\pocketmine\entity\Entity $entity, int $amount) : int

Adds anger towards the entity (ignored for invalid suspects) and returns the new anger.

initEntity() protected ​

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

isDigging() ​

php
public function isDigging() : bool

isEmerging() ​

php
public function isEmerging() : bool

isFireProof() ​

php
public function isFireProof() : bool

isInSonicBoomRange() ​

php
public function isInSonicBoomRange(\pocketmine\entity\Entity $target) : bool

isListening() ​

php
public function isListening() : bool

Returns whether a vibration is travelling to the warden.

isValidSuspect() ​

php
public function isValidSuspect(?\pocketmine\entity\Entity $entity) : bool

Returns whether the warden may be angry at the entity: living, not a warden, and for players in survival or adventure mode.

onDispose() protected ​

php
protected function onDispose() : void

onVibration() ​

php
public function onVibration(\pocketmine\math\Vector3 $pos, \pocketmine\world\vibration\GameEvent $event, ?\pocketmine\entity\Entity $source, ?\pocketmine\block\Block $affected, float $distance) : void

playAmbientSound() protected ​

php
protected function playAmbientSound() : void

registerGoals() protected ​

php
protected function registerGoals() : void

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

setSuspiciousLocation() ​

php
public function setSuspiciousLocation(?\pocketmine\math\Vector3 $location) : void

sonicBoom() ​

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

The 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() ​

php
public function startEmerging() : void

Plays the emerging animation (as when summoned by a sculk shrieker): the warden doesn't move or hear anything for 7 seconds.

syncNetworkData() protected ​

php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void

tickAi() protected ​

php
protected function tickAi(int $currentTick) : void

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