Skip to content

WardenSpawnTracker 5.46.0 ​

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

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 ​

php
public const DECREASE_INTERVAL_TICKS = 12000

MAX_WARNING_LEVEL ​

php
public const MAX_WARNING_LEVEL = 4

PLAYER_SEARCH_RADIUS ​

php
public const PLAYER_SEARCH_RADIUS = 16

WARDEN_CHECK_DIAMETER ​

php
public const WARDEN_CHECK_DIAMETER = 48

Size of the box around the shrieker in which an existing warden prevents warnings

WARNING_COOLDOWN_TICKS ​

php
public const WARNING_COOLDOWN_TICKS = 200

Methods ​

__construct() ​

php
public function __construct(int $currentTick)

copyFrom() ​

php
public function copyFrom(\pocketmine\entity\monster\WardenSpawnTracker $other) : void

getTrackersAround() ​

php
public static function getTrackersAround(\pocketmine\world\World $world, \pocketmine\math\Vector3 $shriekerPos, \pocketmine\player\Player $trigger) : array

Returns the trackers of the trigger player and of the other players within 16 blocks of the shrieker.

getWarningLevel() ​

php
public function getWarningLevel(int $currentTick) : int

increaseWarningLevel() ​

php
public function increaseWarningLevel(int $currentTick) : void

Raises the level by one, unless a warning happened less than 10 seconds ago.

isOnCooldown() ​

php
public function isOnCooldown(int $currentTick) : bool

load() ​

php
public function load(\pocketmine\nbt\tag\CompoundTag $nbt, int $currentTick) : void

reset() ​

php
public function reset(int $currentTick) : void

save() ​

php
public function save(int $currentTick) : \pocketmine\nbt\tag\CompoundTag

setWarningLevel() ​

php
public function setWarningLevel(int $warningLevel) : void

tryWarn() ​

php
public static function tryWarn(\pocketmine\world\World $world, \pocketmine\math\Vector3 $shriekerPos, \pocketmine\player\Player $trigger) : ?int

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

php
public static function tryWarnTrackers(\pocketmine\world\World $world, \pocketmine\math\Vector3 $shriekerPos, array $trackers) : ?int

Second half of WardenSpawnTracker::tryWarn(), with the trackers of the players concerned.

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