Loot Table NPE
WenXin20 opened this issue ยท 15 comments
Minecraft v1.16.4
Forge v35.1.13
Artifacts v2.7.2
Loot chests in villages have been generating empty, and according to the log starting on line 3138, it is possibly being caused by this mod.
Error Log
Alright thanks. Any idea of what mod it could be? This type of error always seems to be the most troublesome and difficult to find the actual source.
This isn't caused by Artifacts, as other mods such as botania and minecolonies have exactly the same issue adding loot pools to loot tables. There's definitely some mod screwing with loot tables, but it could be one that's not mentioned in the log
I'll keep this open until we can figure out what the actual problem is. I'm gonna need a bit more information though, as I have yet to reproduce this issue myself. A full list of mods would be nice.
Here's a list, its not short unfortunately: https://gist.github.com/WenXin20/361656152cd56f7f974199000b94967c
Had this start happening on my friends server. We came to the conclusion it is Chance Cubes, but I am not sure about WenXin20's issue. I just thought I would leave this message here for anyone who has this issue along with chance cubes being installed.
The thing is that if you take out Artifacts-1.16.4-2.7.3, everything works - loot tables are fine, with items from other mods. This problem is server side, in single player there's no such problem.
Same thing with other mod christmasfestivity-1.3.6-1.16.4.
@WenXin20 are there ever any vanilla chests that do have items in them? And if so, what items are usually in them? Because while I had the chance cubes mod installed, which I know you don't have installed, the jungle temple arrow dispensers would have chance cubes and arrows in them
I checked the Pillager Outpost chest, it had an artifacts Cross Necklace in it. It's just the chests that show in the log that won't have any items generating.
Fast way to check loot tables spawns is using command block.
For example,
/setblock ~ ~ ~-1 minecraft:chest{LootTable:"minecraft:chests/simple_dungeon"}
I'd figure I'd give my troubleshooting steps to help track down peoples problems if they come here in the future.
- Look through your logs for the phrase
Couldn't parse loot table
followed by the name of the chest that is showing up empty, here are a few examples:
minecraft:chests/buried_treasure
minecraft:chests/woodland_mansion
minecraft:chests/simple_dungeon
- Under that error should be two sections of errors:
Section 1:
java.lang.NullPointerException: null
at net.minecraft.loot.LootTable.lambda$addPool$2(LootTable.java:207) ~[?:?]
at net.minecraft.loot.LootTable$$Lambda$23064/1593522360.test(Unknown Source) ~[?:?]
at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90) ~[?:1.8.0_51]
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351) ~[?:1.8.0_51]
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) ~[?:1.8.0_51]
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:529) ~[?:1.8.0_51]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:516) ~[?:1.8.0_51]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) ~[?:1.8.0_51]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) ~[?:1.8.0_51]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ~[?:1.8.0_51]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_51]
at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449) ~[?:1.8.0_51]
at net.minecraft.loot.LootTable.addPool(LootTable.java:207) ~[?:?]
at dan200.computercraft.shared.proxy.ComputerCraftProxyCommon$ForgeHandlers.lootLoad(ComputerCraftProxyCommon.java:184) ~[?:1.95.0]
at net.minecraftforge.eventbus.ASMEventHandler_268_ForgeHandlers_lootLoad_LootTableLoadEvent.invoke(.dynamic) ~[?:?]
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-3.0.5-service.jar:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) ~[eventbus-3.0.5-service.jar:?]
at net.minecraftforge.event.ForgeEventFactory.loadLootTable(ForgeEventFactory.java:656) ~[?:?]
at net.minecraftforge.common.ForgeHooks.loadLootTable(ForgeHooks.java:863) ~[?:?]
at net.minecraft.loot.LootTableManager.lambda$apply$0(LootTableManager.java:40) [?:?]
at net.minecraft.loot.LootTableManager$$Lambda$23039/1333221367.accept(Unknown Source) [?:?]
at java.util.HashMap.forEach(HashMap.java:1280) [?:1.8.0_51]
at net.minecraft.loot.LootTableManager.func_212853_a_(LootTableManager.java:38) [?:?]
at net.minecraft.loot.LootTableManager.func_212853_a_(LootTableManager.java:16) [?:?]
at net.minecraft.client.resources.ReloadListener.func_215269_a(SourceFile:13) [?:?]
at net.minecraft.client.resources.ReloadListener$$Lambda$17344/510280424.accept(Unknown Source) [?:?]
at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:656) [?:1.8.0_51]
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:632) [?:1.8.0_51]
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442) [?:1.8.0_51]
at net.minecraft.resources.AsyncReloader.func_219557_a(SourceFile:71) [?:?]
at net.minecraft.resources.AsyncReloader$$Lambda$17680/902394858.run(Unknown Source) [?:?]
at net.minecraft.util.concurrent.TickDelayedTask.run(SourceFile:18) [?:?]
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144) [?:?]
at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23) [?:?]
at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:733) [?:?]
at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:159) [?:?]
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118) [?:?]
at net.minecraft.server.MinecraftServer.func_213205_aW(MinecraftServer.java:716) [?:?]
at net.minecraft.server.MinecraftServer.func_213168_p(MinecraftServer.java:710) [?:?]
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213161_c(SourceFile:127) [?:?]
at net.minecraft.server.MinecraftServer.func_240780_a_(MinecraftServer.java:1304) [?:?]
at com.bluepowermod.BluePower.onServerAboutToStart(BluePower.java:117) [?:0.5.231-alpha]
at net.minecraftforge.eventbus.ASMEventHandler_906_BluePower_onServerAboutToStart_FMLServerAboutToStartEvent.invoke(.dynamic) [?:?]
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) [eventbus-3.0.5-service.jar:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) [eventbus-3.0.5-service.jar:?]
at net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerAboutToStart(ServerLifecycleHooks.java:96) [?:?]
at net.minecraft.server.integrated.IntegratedServer.func_71197_b(IntegratedServer.java:59) [?:?]
at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:620) [?:?]
at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:232) [?:?]
at net.minecraft.server.MinecraftServer$$Lambda$23735/114662667.run(Unknown Source) [?:?]
Section 2:
[18:13:07] [Server thread/ERROR]: Exception caught during firing event: null
Index: 14
Listeners:
0: NORMAL
1: ASM: chanceCubes.CCubesCore@7b0e4710 lootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
2: ASM: class vectorwing.farmersdelight.setup.CommonEventHandler onLootLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
3: ASM: class dan200.computercraft.shared.proxy.ComputerCraftProxyCommon$ForgeHandlers lootLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
4: ASM: se.mickelus.tetra.items.loot.DragonSinewItem$LootTableHandler@782f8e09 onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
5: ASM: class cursedflames.bountifulbaubles.common.loot.LootTableInjector onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
6: ASM: class artifacts.common.init.LootTables$LootTableEvents onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
7: net.minecraftforge.eventbus.EventBus$$Lambda$2894/1911860918@70cd04e9
8: ASM: class its_meow.betteranimalsplus.common.CommonEventHandler onLootLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
9: ASM: class andrews.pandoras_creatures.util.loot_table.PCLootTableHandler onInjectLoot(Lnet/minecraftforge/event/LootTableLoadEvent;)V
10: ASM: com.bluepowermod.BluePower@542a7409 onLootLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
11: ASM: class com.minecraftabnormals.upgrade_aquatic.core.events.LootEvents onInjectLoot(Lnet/minecraftforge/event/LootTableLoadEvent;)V
12: ASM: class com.stal111.forbidden_arcanus.event.LootTableListener onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
13: ASM: enemeez.simplefarming.events.LootTableHandler@7069aa4a lootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
14: ASM: org.cyclops.cyclopscore.helper.LootHelpers@65d6ce5c onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
15: ASM: vazkii.quark.content.tools.module.AncientTomesModule@c6d8e0a onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
16: ASM: vazkii.quark.content.tools.module.ColorRunesModule@734805e0 onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
17: LOWEST
18: ASM: class com.minecraftabnormals.abnormals_core.core.registry.LootInjectionRegistry onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
I personally found Section 2 to be more useful to me, it's essentially an indexed list of all of the mods that are affecting that specific loot table.
-
Disable any mods you expect to be problematic and make note of them, you'll lose track if Minecraft takes too long to launch and you get distracted. The best strategy is disabling half and seeing if it works, then working with the broken half, but maybe some mods you have installed have a poor strategy.
-
Spawn a related loot chest with one of two commands and see if it works.
/give @p minecraft:chest{BlockEntityTag:{LootTable:"minecraft:chests/simple_dungeon"}}
/setblock ~ ~ ~-1 minecraft:chest{LootTable:"minecraft:chests/simple_dungeon"}
In my case the broken loot table was coming from ChanceCubes and I found this in their issue tracker.
TheTurkeyDev/ChanceCubes#225
They suggest disabling ChestLoot
in the /config/chancecubes/chancecubes-server.toml
However some of you guys mentioned you don't have chance cubes installed so hopefully the above helps.
I think this can be closed. It seems this can happen if another mods injects an unnamed loot pool. For me, this was being caused by Wyrmroost. Chance Cubes might have a similar problem. I was able to figure this out because the mod Enigmatic Legacy added an optional crash to print out which mods where causing the npe with loot chests.