Fabric API

Fabric API

106M Downloads

Loot table data generation does not include random sequences

haykam821 opened this issue ยท 1 comments

commented

The random_sequence field is expected for loot tables produced by data generation, but instead, it is not present. As a result, generated loot tables use the world random rather than a loot table-specific random sequence.

Compare the implementations of the Fabric API FabricLootTableProviderImpl#run and vanilla LootTableProvider#run methods. The Fabric API implementation does not call builder.randomSequenceId(identifier) when accepting each loot table builder from the provider, leading to this issue.

As a workaround, the following code can be added to the end of FabricBlockLootTableProvider#generate implementations in individual mods:

this.lootTables.forEach((id, lootTable) -> {
	lootTable.randomSequenceId(id);
});
commented

Can we get rid of FabricLootTableProvider(s) to avoid further similar bugs? Recently I also discovered a similar bug and they are difficult to track