Datapack failing to reload with error "Cannot read field "f_19853_" because "serverplayer" is null"
DynamicMountain opened this issue ยท 4 comments
Was trying to create a custom datapack for other mods, when I noticed none were loading on running /reload, and the console was printing the error below.
Replicated in both crowded modpack, as well as fresh install with EpicFight as the only installed mod. Only active datapacks are the built in ones
Relevant line cherry-picked "Caused by: java.lang.NullPointerException: Cannot read field "f_19853_" because "serverplayer" is null
at TRANSFORMER/[email protected]/yesman.epicfight.events.WorldEvents.onDatapackSync(WorldEvents.java:26)"
FULL ERROR CODE
Failed to execute reload
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot read field "f_19853_" because "serverplayer" is null
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:722)
at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
at TRANSFORMER/[email protected]/net.minecraft.server.TickTask.run(TickTask.java:18)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:157)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:799)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:164)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:131)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:782)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:776)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:140)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_129861_(MinecraftServer.java:1340)
at TRANSFORMER/[email protected]/net.minecraft.server.commands.ReloadCommand.m_138235_(ReloadCommand.java:22)
at TRANSFORMER/[email protected]/net.minecraft.server.commands.ReloadCommand.m_138228_(ReloadCommand.java:53)
at MC-BOOTSTRAP/[email protected]/com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:263)
at TRANSFORMER/[email protected]/net.minecraft.commands.Commands.m_82117_(Commands.java:232)
at TRANSFORMER/[email protected]/net.minecraft.server.network.ServerGamePacketListenerImpl.m_9957_(ServerGamePacketListenerImpl.java:1153)
at TRANSFORMER/[email protected]/net.minecraft.server.network.ServerGamePacketListenerImpl.m_143628_(ServerGamePacketListenerImpl.java:1131)
at TRANSFORMER/[email protected]/net.minecraft.server.network.ServerGamePacketListenerImpl.m_7388_(ServerGamePacketListenerImpl.java:1117)
at TRANSFORMER/[email protected]/net.minecraft.network.protocol.game.ServerboundChatPacket.m_5797_(ServerboundChatPacket.java:30)
at TRANSFORMER/[email protected]/net.minecraft.network.protocol.game.ServerboundChatPacket.m_5797_(ServerboundChatPacket.java:7)
at TRANSFORMER/[email protected]/net.minecraft.network.protocol.PacketUtils.m_131356_(PacketUtils.java:22)
at TRANSFORMER/[email protected]/net.minecraft.server.TickTask.run(TickTask.java:18)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:157)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:799)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:164)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:131)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:782)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:776)
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:140)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:762)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:689)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:261)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException: Cannot read field "f_19853_" because "serverplayer" is null
at TRANSFORMER/[email protected]/yesman.epicfight.events.WorldEvents.onDatapackSync(WorldEvents.java:26)
at net.minecraftforge.eventbus.ASMEventHandler_392_WorldEvents_onDatapackSync_OnDatapackSyncEvent.invoke(.dynamic)
at MC-BOOTSTRAP/[email protected]/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
at MC-BOOTSTRAP/[email protected]/net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)
at MC-BOOTSTRAP/[email protected]/net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)
at TRANSFORMER/[email protected]/net.minecraft.server.players.PlayerList.m_11315_(PlayerList.java:813)
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$reloadResources$19(MinecraftServer.java:1334)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
... 34 more
Hello, do you using a dedicated server rather than Forge or have you installed other mods?
Using my client only, with curseforge to manage modpacks. I also created a new blank modpack which only included EpicFight and got the same error when running /reload. The game isn't actually crashing, but its causing all datapacks to revert to initial states, meaning I can't load any custom weapon datapacks or extra datapacks while the mod is active.
Running on forge 40.1.0, using the EpicFight 18.0.3 beta.
Would the curseforge itself be a problem? I've never got this issue with many tries. Could you check it?