Skip to content

WardenAnger 5.46.0 ​

final class · pocketmine\entity\monster\WardenAnger · source

The warden's anger towards each suspect (vanilla minecraft:anger_level): every disturbance adds anger to the entity which caused it, anger decays by 1 every second, and a suspect with 80 or more anger is a target. The anger level of the warden is the highest anger towards any suspect (it drives the heartbeat and the ambient sounds).

Values from Mojang's bedrock-samples behavior_pack/entities/warden.json: angry_threshold 80, angry_boost 20 (added when the warden roars at a new target), default_annoyingness 35, default_projectile_annoyingness 10, max_anger 150, anger_decrement_interval 1 s; agitated sounds from 40.

Constants ​

AGITATED_THRESHOLD ​

php
public const AGITATED_THRESHOLD = 40

ANGRY_BOOST ​

php
public const ANGRY_BOOST = 20

ANGRY_THRESHOLD ​

php
public const ANGRY_THRESHOLD = 80

DEFAULT_ANNOYINGNESS ​

php
public const DEFAULT_ANNOYINGNESS = 35

HURT_ANNOYINGNESS ​

php
public const HURT_ANNOYINGNESS = 100

Anger added by hurting the warden (vanilla Java: 100).

MAX_ANGER ​

php
public const MAX_ANGER = 150

MAX_SUSPECTS ​

php
public const MAX_SUSPECTS = 100

Most suspects remembered (vanilla Java keeps at most 100).

PROJECTILE_ANNOYINGNESS ​

php
public const PROJECTILE_ANNOYINGNESS = 10

Methods ​

clear() ​

php
public function clear() : void

decay() ​

php
public function decay(int $amount = 1) : void

Lowers every anger by the given amount, forgetting suspects whose anger reaches 0.

forget() ​

php
public function forget(int $entityId) : void

get() ​

php
public function get(int $entityId) : int

getAll() ​

php
public function getAll() : array

getAngerLevel() ​

php
public function getAngerLevel() : int

Returns the warden's anger level: the highest anger towards any suspect.

getAngriest() ​

php
public function getAngriest(?\Closure $isValid = null) : ?int

Returns the suspects the warden is angry at (anger >= 80), best target first: players before other mobs, then the angriest first (vanilla priority).

increase() ​

php
public function increase(int $entityId, bool $isPlayer, int $amount) : int

Adds anger towards the entity and returns its new anger, capped at WardenAnger::MAX_ANGER.

isAngryAt() ​

php
public function isAngryAt(int $entityId) : bool

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