Skip to content

MonsterSpawner ​

class · pocketmine\block\tile\MonsterSpawner · source

Extends Spawnable

Deprecated

This class is deprecated.

Constants ​

DEFAULT_MAX_NEARBY_ENTITIES ​

php
public const DEFAULT_MAX_NEARBY_ENTITIES = 6

DEFAULT_MAX_SPAWN_DELAY ​

php
public const DEFAULT_MAX_SPAWN_DELAY = 800

DEFAULT_MIN_SPAWN_DELAY ​

php
public const DEFAULT_MIN_SPAWN_DELAY = 200

DEFAULT_REQUIRED_PLAYER_RANGE ​

php
public const DEFAULT_REQUIRED_PLAYER_RANGE = 16

DEFAULT_SPAWN_PER_ATTEMPT 5.46.0 ​

php
public const DEFAULT_SPAWN_PER_ATTEMPT = 4

Vanilla SpawnCount default (spawners made by world generation only store the mob).

DEFAULT_SPAWN_RANGE ​

php
public const DEFAULT_SPAWN_RANGE = 4

Methods ​

addAdditionalSpawnData() protected ​

php
protected function addAdditionalSpawnData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

getEntityTypeId() 5.46.0 ​

php
public function getEntityTypeId() : string

Returns the Bedrock identifier of the mob shown in (and spawned by) the spawner, or ":" if it's empty.

getLastUpdateTick() 5.46.0 ​

php
public function getLastUpdateTick() : int

Server tick of the last spawner update, to keep a single update chain (not saved).

getMaxNearbyEntities() 5.46.0 ​

php
public function getMaxNearbyEntities() : int

getMaxSpawnDelay() 5.46.0 ​

php
public function getMaxSpawnDelay() : int

getMinSpawnDelay() 5.46.0 ​

php
public function getMinSpawnDelay() : int

getRequiredPlayerRange() 5.46.0 ​

php
public function getRequiredPlayerRange() : int

getSpawnDelay() 5.46.0 ​

php
public function getSpawnDelay() : int

Ticks left before the next spawn attempt; -1 means a new delay is drawn first.

getSpawnPerAttempt() 5.46.0 ​

php
public function getSpawnPerAttempt() : int

getSpawnRange() 5.46.0 ​

php
public function getSpawnRange() : int

readSaveData() ​

php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

setEntityTypeId() 5.46.0 ​

php
public function setEntityTypeId(string $entityTypeId) : void

Sets the mob of the spawner, e.g. "minecraft:zombie". This drops any spawn data or potentials loaded from the world, since they would override it.

setLastUpdateTick() 5.46.0 ​

php
public function setLastUpdateTick(int $tick) : void

setSpawnDelay() 5.46.0 ​

php
public function setSpawnDelay(int $spawnDelay) : void

writeSaveData() protected ​

php
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

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