Crash w/ Compact Fun Ores
WenXin20 opened this issue ยท 9 comments
Minecraft v1.14.4
Forge v28.1.117
Compact Ores v1.2.0
Fun Ores v2.4.1+15
In the compactores.toml
file, I had added Fun Ores to the config, but found out that my game will crash after breaking a Compact Zombie Ore. I assume it crashes because it tries to retrieve items from a mob loot table.
Config: compactores.zip
(Feel free to add to the mod itself, I've added a bunch of modded ores to this file.)
Wow, did not realize that Unique Enchantments was involved! Thanks for looking into this.
Should I make a report to Unique Enchantments as well?
This issue seems to be caused by a combination of Compact Ores, Fun Ores and Unique Enchantments.
The setup that I found doesn't crash the game, but it causes a similar stacktrace which reports a NullPointerException
in a Unique Enchantments event handler. Unique Enchantments seems to expect the parameters for that event to always be non-null, which they usually are, but for some reason, they get lost when the Compact Ores loot table generates the Fun Ores loot table (which has a random_chance_with_looting
condition which causes a looting level lookup which runs the Unique Enchantments event handler). The log even warns about the missing parameters:
[03Feb2020 13:18:58.319] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[3]->{minecraft:entities/drowned}.pools[0].entries[0].functions[1]: Parameters [<parameter minecraft:killer_entity>] are not provided in this context
[03Feb2020 13:18:58.319] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[1].condition[0]: Parameters [<parameter minecraft:killer_entity>] are not provided in this context
[03Feb2020 13:18:58.319] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[2]->{minecraft:entities/husk}.pools[1].condition[1]: Parameters [<parameter minecraft:killer_entity>] are not provided in this context
[03Feb2020 13:18:58.319] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[2]->{minecraft:entities/husk}.pools[1].condition[0]: Parameters [<parameter minecraft:last_damage_player>] are not provided in this context
[03Feb2020 13:18:58.319] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[0]->{minecraft:entities/zombie}.pools[1].condition[1]: Parameters [<parameter minecraft:killer_entity>] are not provided in this context
[03Feb2020 13:18:58.319] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[1]->{minecraft:entities/zombie_villager}.pools[0].entries[0].functions[1]: Parameters [<parameter minecraft:killer_entity>] are not provided in this context
[03Feb2020 13:18:58.319] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[2]->{minecraft:entities/husk}.pools[0].entries[0].functions[1]: Parameters [<parameter minecraft:killer_entity>] are not provided in this context
[03Feb2020 13:18:58.320] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[0]->{minecraft:entities/zombie}.pools[1].condition[0]: Parameters [<parameter minecraft:last_damage_player>] are not provided in this context
[03Feb2020 13:18:58.320] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[1]->{minecraft:entities/zombie_villager}.pools[1].condition[1]: Parameters [<parameter minecraft:killer_entity>] are not provided in this context
[03Feb2020 13:18:58.320] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[0]->{minecraft:entities/zombie}.pools[0].entries[0].functions[1]: Parameters [<parameter minecraft:killer_entity>] are not provided in this context
[03Feb2020 13:18:58.320] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[3]->{minecraft:entities/drowned}.pools[1].condition[0]: Parameters [<parameter minecraft:last_damage_player>] are not provided in this context
[03Feb2020 13:18:58.320] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[3]->{minecraft:entities/drowned}.pools[1].condition[1]: Parameters [<parameter minecraft:killer_entity>] are not provided in this context
[03Feb2020 13:18:58.320] [Server thread/WARN] [net.minecraft.world.storage.loot.LootTableManager/]: Found validation problem in {compactores:compact_funores_zombie_ore}.pools[0].entries[0]->{funores:blocks/zombie_ore}.pools[0].entries[1]->{minecraft:entities/zombie_villager}.pools[1].condition[0]: Parameters [<parameter minecraft:last_damage_player>] are not provided in this context
(Note that these missing parameters do not prevent the loot table itself from working at all, they only crash the event handler, and change the behavior of the loot table)
I don't know if there is anything I can change in the compact ores loot table that would fix this issue. These parameters not being present is a vanilla Minecraft feature. The issue would probably need to be fixed in Unique Enchantments.
To go around the problem, you could use useGetDrops=true
in the compact ores config for Fun Ores, since this avoids the compact ores loot table which avoids the missing parameters. That's not a good long-term solution though.
I would like to find a way to make sure the parameters exist somehow, so I'm not closing this issue yet until I have found a way to do so or concluded that doing so is not possible. (The problem here is that these parameters are for killing another entity, but we're only breaking blocks here, so I don't know where these parameters even come from with the normal Fun Ores)
I checked what Fun Ores does to make its loot tables work in the first place, to find out if I could replicate that somehow to eliminate the invalid loot tables (that cause Unique Enchantments to break). It turns out that Fun Ores does a lot of magic in getDrops which I can't reasonably implement support for in Compact Ores. The correct solution for this problem is using useGetDrops=true
in the compact ores config file, which means that this special getDrops
from Fun Ores is used instead of the generic one.
I don't know if they all work the same way, but every one which references mob loot tables in its loot table (like Zombie Ore) needs useGetDrops=true
Fun Ores should work without any problems in 1.15. It is even supported in the default config in Compact Ores 2.1.2, so all you should have to do is install the latest version of Compact Ores and Fun Ores.