LootData 5.46.0
Read access to the vanilla data used by loot tables, in the vanilla data cache prepared by \pocketmine\world\generator\vanilla\VanillaDataFetcher (Mojang's data generator output, never shipped): <root>/data/minecraft/{loot_table,predicate,enchantment,tags/item,tags/enchantment,...} <root>/java_items.json (max stack size, max damage and enchantability of every Java item) <root>/geyser/items.json (GeyserMC's Java -> Bedrock item mappings)
Constants
GEYSER_ITEMS_FILE
public const GEYSER_ITEMS_FILE = "geyser/items.json"JAVA_ITEMS_FILE
public const JAVA_ITEMS_FILE = "java_items.json"Methods
__construct()
public function __construct(string $root)bool()
public static function bool(mixed $value, bool $default) : boolenchantment()
public function enchantment(string $id) : ?\pocketmine\loot\JavaEnchantmentenchantmentIds()
public function enchantmentIds() : arrayIds of the enchantment registry in registry order (vanilla loads data-driven registries sorted by id).
getRoot()
public function getRoot() : stringholderSet()
public function holderSet(string $registry, mixed $spec) : arrayResolves a holder set: "#tag", a single id or a list of ids.
isAvailable()
public static function isAvailable(string $root) : boolWhether $root holds the loot table data (vanilla data format 3 or later).
itemExists()
public function itemExists(string $id) : boolitemInfo()
public function itemInfo(string $id) : arrayitemIs()
public function itemIs(string $itemId, mixed $spec) : boolWhether an item matches a holder set spec ("#tag", id or list).
lootTableJson()
public function lootTableJson(string $id) : ?arraynamespaced()
public static function namespaced(string $id) : stringAdds the "minecraft:" namespace to an id that has none.
predicateJson()
public function predicateJson(string $id) : mixedreadJson()
public function readJson(string $relativePath) : mixedReads a JSON file of the cache, or returns null if it does not exist.
stripNamespace()
public static function stripNamespace(string $id) : stringtag()
public function tag(string $registry, string $id, int $depth = 0) : arrayMembers of a tag (recursively resolved, in tag order without duplicates, like vanilla's TagLoader). $registry is the tag directory: "item", "enchantment", "entity_type", "instrument"...
