LootCompiler 5.46.0
Turns the vanilla loot table JSON (Java Edition 26.3 format: "condition"/"modifier", older "conditions"/"functions" also accepted) into loot tables, with conditions and functions compiled to closures.
Supported conditions: all_of, any_of, inverted, reference, random_chance, random_chance_with_enchanted_bonus, killed_by_player, survives_explosion, table_bonus, match_tool, match_block (block_state_property), entity_properties, damage_source_properties and location_check (through the context resolvers), time_check, value_check. Supported functions: set_count, set_damage, enchant_randomly, enchant_with_levels, set_enchantments, set_potion, set_stew_effect, set_name, explosion_decay, apply_bonus, furnace_smelt, enchanted_count_increase (looting_enchant), limit_count, set_ominous_bottle_amplifier, set_instrument, filtered, discard, sequence, set_item. exploration_map leaves the map empty (as vanilla does when no structure is found); functions that only copy block data or set cosmetic components (copy_components, copy_state, set_components...) do nothing. None of the unsupported ones use the random, so the rest of the rolls stay exact.
Properties
$data
public readonly \pocketmine\loot\LootData $dataMethods
__construct()
public function __construct(\pocketmine\loot\LootData $data, \Closure $tableResolver, \Closure $warn)condition()
public function condition(mixed $json) : \ClosureconditionsOf()
public function conditionsOf(array $json) : ?\ClosureThe conditions of an object ("condition" in 26.x, "conditions" before), all of which must pass.
entry()
public function entry(array $json) : \pocketmine\loot\LootEntryfunction()
public function function(mixed $json) : \ClosurefunctionsOf()
public function functionsOf(array $json) : ?\ClosureThe functions of an object ("modifier" in 26.x, "functions" before), applied in order.
table()
public function table(string $id, array $json) : \pocketmine\loot\LootTablewarn()
public function warn(string $key, string $message) : void