Loot Modifiers Called Multiple Times
Trainerredstone7 opened this issue ยท 0 comments
Forestry version: 6.0.11 for Minecraft 1.16.5
Other mods: Patchouli 53.2, Relics 0.3.4, Curios API 4.0.8.0
Forestry's ConditionLootModifier causes other mods' global loot modifiers to fire multiple times.
To replicate:
- Create a new world with the mods listed above and this datapack, which uses the Relics mod's loot modifier to add a 100% chance for a grass block to the loot tables for abandoned mineshaft carts and dungeon chests.
- run the following command: /loot give [username] loot minecraft:chests/abandoned_mineshaft
- Note that 4 grass blocks (among other loot) are added to your inventory when only 1 should have been added.
- Clear your inventory and run /loot give [username] loot minecraft:chests/simple_dungeon
- Note that 2 grass blocks are added to your inventory when only 1 should have been added.
This seems to have to do with the for loop in ConditionLootModifier's doApply applying all modifiers again. While ConditionLootModifier prevents itself from changing the loot table more than once, other mods' loot modifiers don't expect to be applied multiple times.
.