MonsterSpawner
Extends Transparent
Monster spawner. While a player (not a spectator) is within RequiredPlayerRange (16) blocks, the delay counts down; then SpawnCount (4) attempts each pick a spot within SpawnRange (4) blocks horizontally and one block up or down, and spawn the mob there if its box is free of blocks and liquids, monsters are allowed (not Peaceful) and it is dark enough for monsters (light 7 or less, 11 in the Nether). Nothing spawns while MaxNearbyEntities (6) mobs of the type are within SpawnRange of the spawner. After a spawn the delay is drawn again between MinSpawnDelay (200) and MaxSpawnDelay (800) ticks (vanilla BaseSpawner.serverTick).
Constants
MONSTER_LIGHT_LIMIT 5.46.0
public const MONSTER_LIGHT_LIMIT = 7NETHER_MONSTER_LIGHT_LIMIT 5.46.0
public const NETHER_MONSTER_LIGHT_LIMIT = 11Methods
getDropsForCompatibleTool()
public function getDropsForCompatibleTool(\pocketmine\item\Item $item) : arraygetSupportType()
public function getSupportType(int $facing) : \pocketmine\block\utils\SupportTypegetXpDropAmount() protected
protected function getXpDropAmount() : intonInteract() 5.46.0
public function onInteract(\pocketmine\item\Item $item, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : boolUsing a spawn egg on a spawner sets the mob it shows (and would spawn). The egg is consumed outside creative.
onScheduledUpdate()
public function onScheduledUpdate() : voidtickSpawner() 5.46.0
public function tickSpawner(\pocketmine\block\tile\MonsterSpawner $tile, int $elapsed = 1) : intRuns the spawner for the elapsed ticks while a player is near. Returns the number of mobs spawned.
