Skip to content

TrialSpawner 5.47.0 ​

class · pocketmine\block\tile\TrialSpawner · source

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 ​

php
public const TAG_NORMAL_CONFIG = "normal_config"

TAG_OMINOUS_CONFIG ​

php
public const TAG_OMINOUS_CONFIG = "ominous_config"

TAG_REQUIRED_PLAYER_RANGE ​

php
public const TAG_REQUIRED_PLAYER_RANGE = "required_player_range"

TAG_TARGET_COOLDOWN_LENGTH ​

php
public const TAG_TARGET_COOLDOWN_LENGTH = "target_cooldown_length"

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos)

addAdditionalSpawnData() protected ​

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

broadcastSpawnData() ​

php
public function broadcastSpawnData() : void

Sends the mob shown in the spawner to the players who can see it.

getLastUpdateTick() ​

php
public function getLastUpdateTick() : int

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

getNextSpawnData() ​

php
public function getNextSpawnData() : ?\pocketmine\block\trialspawner\TrialSpawnerSpawnData

The mob the spawner spawns next and shows, if it was picked already.

getNormalConfig() ​

php
public function getNormalConfig() : \pocketmine\block\trialspawner\TrialSpawnerConfig

getNormalConfigName() ​

php
public function getNormalConfigName() : ?string

Name of the normal config ("minecraft:trial_chamber/breeze/normal"), or null if the config is stored inline or the spawner has none.

getOminousConfig() ​

php
public function getOminousConfig() : \pocketmine\block\trialspawner\TrialSpawnerConfig

getOminousConfigName() ​

php
public function getOminousConfigName() : ?string

getRequiredPlayerRange() ​

php
public function getRequiredPlayerRange() : int

getTargetCooldownLength() ​

php
public function getTargetCooldownLength() : int

Ticks between the end of a fight and the next one (vanilla: 36000, 30 minutes).

readSaveData() ​

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

setConfigNames() ​

php
public function setConfigNames(?string $normal, ?string $ominous) : void

Sets the configs by name (see TrialSpawnerConfigs); null for none.

setEntityToSpawn() ​

php
public function setEntityToSpawn(string $entityId) : void

Makes the spawner spawn the given mob ("minecraft:zombie") in both modes, like a spawn egg used on it. The fight is reset.

setLastUpdateTick() ​

php
public function setLastUpdateTick(int $tick) : void

setRequiredPlayerRange() ​

php
public function setRequiredPlayerRange(int $range) : void

setTargetCooldownLength() ​

php
public function setTargetCooldownLength(int $ticks) : void

writeSaveData() protected ​

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

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.