LootSupplier {
contextType: "block"
pools: [
LootPool
LootPool
LootPool
]
functions: [
LootFunction
LootFunction
]
}
A "loot table json file" is a LootSupplier. And inside, they look sort of like this. If you're lucky enough to have fabric installed, you can grab all of this information from any supplier.
if (supplier instanceof FabricLootSupplier) {
LootContextType contextType = ((FabricLootSupplier)supplier).getType();
List<LootPool> pools = ((FabricLootSupplier)supplier).getPools();
List<LootFunction> functions = ((FabricLootSupplier)supplier).getFunctions();
}
These can then be copied or modified, then poured back into a new LootSupplier
FabricLootSupplierBuilder replacement = FabricLootSupplierBuilder.builder();
replacement.withType(contextType);
for(LootPool pool : pools) {
FabricLootPoolBuilder modifiablePool = FabricLootPoolBuilder.of(existingPool);
// your Evil Stuff goes here
replacement.withPool(modifiablePool);
}
replacement.withFunctions(functions); //Not a lot of fun Evil that can be done here.
We can then completely overwrite the FabricLootSupplierBuilder we've been given in our LootTableLoadingCallback
setter.set(replacement.create());
return;
thank you. now i can do evil things