TrialSpawner 5.47.0
Extends Spawnable
Block entity of a trial spawner: its normal and ominous configs (by name, like those of trial chambers, or stored inline), its range and cooldown, and the state of the current fight (TrialSpawnerData). The spawner block runs it (see \pocketmine\block\TrialSpawner).
Constants
TAG_NORMAL_CONFIG
public const TAG_NORMAL_CONFIG = "normal_config"TAG_OMINOUS_CONFIG
public const TAG_OMINOUS_CONFIG = "ominous_config"TAG_REQUIRED_PLAYER_RANGE
public const TAG_REQUIRED_PLAYER_RANGE = "required_player_range"TAG_TARGET_COOLDOWN_LENGTH
public const TAG_TARGET_COOLDOWN_LENGTH = "target_cooldown_length"Methods
__construct()
public function __construct(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos)addAdditionalSpawnData() protected
protected function addAdditionalSpawnData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidbroadcastSpawnData()
public function broadcastSpawnData() : voidSends the mob shown in the spawner to the players who can see it.
getLastUpdateTick()
public function getLastUpdateTick() : intServer tick of the last spawner update, to keep a single update chain (not saved).
getNextSpawnData()
public function getNextSpawnData() : ?\pocketmine\block\trialspawner\TrialSpawnerSpawnDataThe mob the spawner spawns next and shows, if it was picked already.
getNormalConfig()
public function getNormalConfig() : \pocketmine\block\trialspawner\TrialSpawnerConfiggetNormalConfigName()
public function getNormalConfigName() : ?stringName of the normal config ("minecraft:trial_chamber/breeze/normal"), or null if the config is stored inline or the spawner has none.
getOminousConfig()
public function getOminousConfig() : \pocketmine\block\trialspawner\TrialSpawnerConfiggetOminousConfigName()
public function getOminousConfigName() : ?stringgetRequiredPlayerRange()
public function getRequiredPlayerRange() : intgetTargetCooldownLength()
public function getTargetCooldownLength() : intTicks between the end of a fight and the next one (vanilla: 36000, 30 minutes).
readSaveData()
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidsetConfigNames()
public function setConfigNames(?string $normal, ?string $ominous) : voidSets the configs by name (see TrialSpawnerConfigs); null for none.
setEntityToSpawn()
public function setEntityToSpawn(string $entityId) : voidMakes the spawner spawn the given mob ("minecraft:zombie") in both modes, like a spawn egg used on it. The fight is reset.
setLastUpdateTick()
public function setLastUpdateTick(int $tick) : voidsetRequiredPlayerRange()
public function setRequiredPlayerRange(int $range) : voidsetTargetCooldownLength()
public function setTargetCooldownLength(int $ticks) : voidwriteSaveData() protected
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void