PatrolSpawner 5.46.0
Spawns pillager patrols (vanilla Bedrock spawn_rules/pillager_patrol.json):
- once the world time has reached 120000 ticks (5 days), every 12000-13200 ticks an attempt is made, which goes ahead 20% of the time, in the Overworld and not in peaceful;
- a random player (not a spectator) is picked; the patrol spawns on the surface 24-48 blocks away from them (48-64 when they are in a village), where the light level is 7 or less, outside mushroom fields;
- it is 2-5 pillagers: the first is the captain (ominous banner), the others follow it.
Patrollers are not persistent: they despawn like other monsters.
Constants
MAX_DISTANCE
php
public const MAX_DISTANCE = 48MAX_LIGHT
php
public const MAX_LIGHT = 7MAX_SIZE
php
public const MAX_SIZE = 5MIN_DISTANCE
php
public const MIN_DISTANCE = 24MIN_SIZE
php
public const MIN_SIZE = 2VILLAGE_MAX_DISTANCE
php
public const VILLAGE_MAX_DISTANCE = 64Methods
__construct()
php
public function __construct(\pocketmine\world\World $world)getDelay()
php
public function getDelay() : intTicks left before the next spawn attempt.
spawnPatrol()
php
public function spawnPatrol(\pocketmine\player\Player $player, bool $checkConditions = true) : arrayTries to spawn a patrol around the player. With $checkConditions false, the light level and the biome are not checked (for tests and plugins). Returns the patrol, captain first (empty if no spot was found).
tick()
php
public function tick(int $currentTick) : void