TrialSpawnerConfig 5.47.0
What a trial spawner spawns and how many (vanilla TrialSpawnerConfig): the defaults are those of a config that leaves a field out. A spawner has a normal and an ominous config.
Constants
DEFAULT_SIMULTANEOUS_MOBS
public const DEFAULT_SIMULTANEOUS_MOBS = 2.0DEFAULT_SIMULTANEOUS_MOBS_ADDED_PER_PLAYER
public const DEFAULT_SIMULTANEOUS_MOBS_ADDED_PER_PLAYER = 1.0DEFAULT_SPAWN_RANGE
public const DEFAULT_SPAWN_RANGE = 4DEFAULT_TICKS_BETWEEN_SPAWN
public const DEFAULT_TICKS_BETWEEN_SPAWN = 40DEFAULT_TOTAL_MOBS
public const DEFAULT_TOTAL_MOBS = 6.0DEFAULT_TOTAL_MOBS_ADDED_PER_PLAYER
public const DEFAULT_TOTAL_MOBS_ADDED_PER_PLAYER = 2.0LOOT_CONSUMABLES
public const LOOT_CONSUMABLES = "minecraft:spawners/trial_chamber/consumables"LOOT_ITEMS_TO_DROP_WHEN_OMINOUS
public const LOOT_ITEMS_TO_DROP_WHEN_OMINOUS = "minecraft:spawners/trial_chamber/items_to_drop_when_ominous"LOOT_KEY
public const LOOT_KEY = "minecraft:spawners/trial_chamber/key"TAG_ITEMS_TO_DROP_WHEN_OMINOUS
public const TAG_ITEMS_TO_DROP_WHEN_OMINOUS = "items_to_drop_when_ominous"TAG_LOOT_TABLES_TO_EJECT
public const TAG_LOOT_TABLES_TO_EJECT = "loot_tables_to_eject"TAG_SIMULTANEOUS_MOBS
public const TAG_SIMULTANEOUS_MOBS = "simultaneous_mobs"TAG_SIMULTANEOUS_MOBS_ADDED_PER_PLAYER
public const TAG_SIMULTANEOUS_MOBS_ADDED_PER_PLAYER = "simultaneous_mobs_added_per_player"TAG_SPAWN_POTENTIALS
public const TAG_SPAWN_POTENTIALS = "spawn_potentials"TAG_SPAWN_RANGE
public const TAG_SPAWN_RANGE = "spawn_range"TAG_TICKS_BETWEEN_SPAWN
public const TAG_TICKS_BETWEEN_SPAWN = "ticks_between_spawn"TAG_TOTAL_MOBS
public const TAG_TOTAL_MOBS = "total_mobs"TAG_TOTAL_MOBS_ADDED_PER_PLAYER
public const TAG_TOTAL_MOBS_ADDED_PER_PLAYER = "total_mobs_added_per_player"TICKS_BETWEEN_ITEM_SPAWNERS
public const TICKS_BETWEEN_ITEM_SPAWNERS = 160Ticks between the ominous item spawners of an ominous fight (vanilla: not configurable).
Methods
__construct()
public function __construct(int $spawnRange = self::DEFAULT_SPAWN_RANGE, float $totalMobs = self::DEFAULT_TOTAL_MOBS, float $simultaneousMobs = self::DEFAULT_SIMULTANEOUS_MOBS, float $totalMobsAddedPerPlayer = self::DEFAULT_TOTAL_MOBS_ADDED_PER_PLAYER, float $simultaneousMobsAddedPerPlayer = self::DEFAULT_SIMULTANEOUS_MOBS_ADDED_PER_PLAYER, int $ticksBetweenSpawn = self::DEFAULT_TICKS_BETWEEN_SPAW …calculateTargetSimultaneousMobs()
public function calculateTargetSimultaneousMobs(int $additionalPlayers) : intMobs alive at the same time at most for a fight with 1 + $additionalPlayers players.
calculateTargetTotalMobs()
public function calculateTargetTotalMobs(int $additionalPlayers) : intMobs to spawn in total for a fight with 1 + $additionalPlayers players.
fromArray()
public static function fromArray(array $data) : selfReads a config in the JSON shape of the vanilla data (and of TrialSpawnerConfigData).
fromNbt()
public static function fromNbt(\pocketmine\nbt\tag\CompoundTag $nbt) : selfReads a config stored inline in a trial spawner's data (same field names as the JSON; Bedrock's first trial chamber templates have them this way).
getItemsToDropWhenOminous()
public function getItemsToDropWhenOminous() : stringgetLootTablesToEject()
public function getLootTablesToEject() : arraygetSpawnPotentials()
public function getSpawnPotentials() : arraygetSpawnRange()
public function getSpawnRange() : intgetTicksBetweenItemSpawners()
public function getTicksBetweenItemSpawners() : intgetTicksBetweenSpawn()
public function getTicksBetweenSpawn() : intpickLootTableToEject()
public function pickLootTableToEject() : ?stringPicks the loot table of the rewards by weight, or null if there are none.
pickSpawnData()
public function pickSpawnData() : ?\pocketmine\block\trialspawner\TrialSpawnerSpawnDataPicks one of the spawn potentials by weight, or null if there are none.
toNbt()
public function toNbt() : \pocketmine\nbt\tag\CompoundTagwithSpawning()
public function withSpawning(string $entityId) : selfThe same config spawning only the given mob (a spawn egg used on the spawner).
