TrialSpawnerSpawnData 5.47.0
One entry of a trial spawner's spawn potentials (vanilla SpawnData): the mob to spawn, as entity data ("id" plus a few fields such as "IsBaby" or the slime "Size"), and optionally the equipment loot table it gets.
Constants
TAG_ENTITY
public const TAG_ENTITY = "entity"TAG_EQUIPMENT
public const TAG_EQUIPMENT = "equipment"TAG_ID
public const TAG_ID = "id"TAG_LOOT_TABLE
public const TAG_LOOT_TABLE = "loot_table"TAG_SLOT_DROP_CHANCES
public const TAG_SLOT_DROP_CHANCES = "slot_drop_chances"Methods
__construct()
public function __construct(\pocketmine\nbt\tag\CompoundTag $entity, ?string $equipmentLootTable = null, float $equipmentDropChance = 0.0)arrayToCompound()
public static function arrayToCompound(array $data) : \pocketmine\nbt\tag\CompoundTagConverts decoded JSON entity data to NBT (ints as TAG_Int, floats as TAG_Float).
fromArray()
public static function fromArray(array $data) : selfReads spawn data in the shape of the configs ({"entity": {"id": ...}, "equipment": {...}}).
fromNbt()
public static function fromNbt(\pocketmine\nbt\tag\CompoundTag $nbt) : selfgetEntityData()
public function getEntityData() : \pocketmine\nbt\tag\CompoundTagThe entity data (a copy).
getEntityId()
public function getEntityId() : ?stringThe namespaced type of the mob ("minecraft:breeze"), or null if the data has none.
getEquipmentDropChance()
public function getEquipmentDropChance() : floatgetEquipmentLootTable()
public function getEquipmentLootTable() : ?stringgetSlimeSize()
public function getSlimeSize() : ?intThe slime size given by the data (Java "Size" is the size minus one), or null.
hasOnlyEntityId()
public function hasOnlyEntityId() : boolWhether the data only names the mob: the mob then gets its random spawn variants (vanilla finalizeSpawn, e.g. baby zombies and spider jockeys), unlike mobs with set data.
isBaby()
public function isBaby() : boolofEntity()
public static function ofEntity(string $entityId) : selfSpawn data for a plain mob of the given type ("minecraft:zombie").
toNbt()
public function toNbt() : \pocketmine\nbt\tag\CompoundTag