WardenSpawnTracker 5.46.0
Warning level of a player towards wardens (Java WardenSpawnTracker): every time a sculk shrieker which can summon wardens shrieks because of the player, the level goes up by one (at most once every 10 seconds); at level 4 a warden is summoned. It goes down by one after 10 minutes without warnings.
The level is evaluated lazily from server ticks instead of being ticked.
Constants
DECREASE_INTERVAL_TICKS
public const DECREASE_INTERVAL_TICKS = 12000MAX_WARNING_LEVEL
public const MAX_WARNING_LEVEL = 4PLAYER_SEARCH_RADIUS
public const PLAYER_SEARCH_RADIUS = 16WARDEN_CHECK_DIAMETER
public const WARDEN_CHECK_DIAMETER = 48Size of the box around the shrieker in which an existing warden prevents warnings
WARNING_COOLDOWN_TICKS
public const WARNING_COOLDOWN_TICKS = 200Methods
__construct()
public function __construct(int $currentTick)copyFrom()
public function copyFrom(\pocketmine\entity\monster\WardenSpawnTracker $other) : voidgetTrackersAround()
public static function getTrackersAround(\pocketmine\world\World $world, \pocketmine\math\Vector3 $shriekerPos, \pocketmine\player\Player $trigger) : arrayReturns the trackers of the trigger player and of the other players within 16 blocks of the shrieker.
getWarningLevel()
public function getWarningLevel(int $currentTick) : intincreaseWarningLevel()
public function increaseWarningLevel(int $currentTick) : voidRaises the level by one, unless a warning happened less than 10 seconds ago.
isOnCooldown()
public function isOnCooldown(int $currentTick) : boolload()
public function load(\pocketmine\nbt\tag\CompoundTag $nbt, int $currentTick) : voidreset()
public function reset(int $currentTick) : voidsave()
public function save(int $currentTick) : \pocketmine\nbt\tag\CompoundTagsetWarningLevel()
public function setWarningLevel(int $warningLevel) : voidtryWarn()
public static function tryWarn(\pocketmine\world\World $world, \pocketmine\math\Vector3 $shriekerPos, \pocketmine\player\Player $trigger) : ?intJava WardenSpawnTracker.tryWarn(): a shrieker at the given position was set off by the player. Unless a warden is already nearby or one of the players around is on cooldown, the highest warning level among the players within 16 blocks (and the trigger player) goes up by one and is shared by all of them.
tryWarnTrackers()
public static function tryWarnTrackers(\pocketmine\world\World $world, \pocketmine\math\Vector3 $shriekerPos, array $trackers) : ?intSecond half of WardenSpawnTracker::tryWarn(), with the trackers of the players concerned.
