Pixelmon Saving Entity NBT server crash

This error is resolved by removing SpongeForge from the mod-folder.
Thus it most likely is an error due to SpongeForge and not Pixelmon itself.

EDIT: Is it possible to disable “org.spongepowered.common.entity.SpongeEntitySnapshotBuilder” in anyway to see if that is what’s causing the problem?

EDIT #2: I might add an important detail for those who are familiar with Pixelmon. This error only occurs when I get engaged in battle without having my pokemon sent out.
So if I send out my pokemon prior to starting the battle the error does not occur. If I get engaged in battle (with an NPC Trainer) without my pokemon sent out this error occurs.
I can only speculate that Pixelmon for some reason sends a null-value entity somewhere in the “forced send out” of the pokemon (maybe through an iterative search of available pokemon, where 5/6 slots are empty/null). The function at line 125-141 in the SnapShotBuilder does not seem to do a null-check either.

EDIT #3: Just tested my theory. I gave myself a full team of Pokemon and I did not get the error (might have just been pure luck though, one test is no test). Theory #2 is that Pixelmon tries to create entities for every pokemon in the players party. If the party isn’t full some of these entities will be null. This probably doesn’t matter to Pixelmon since they will do a “slot check” to see if I got any more pokemons before even trying to render them. But it does matter for Sponge.

EDIT #4 In the same session I later removed half of my party so 3 slots were empty. Sure enough the error occured again.
Conclusion: Pixelmon probably iterates over a List/Array of my party --> Instantiates an entity for each element in the array (even if its null/empty) --> SpongeForge sends this to net.minecraft without a null-check (see the function I linked above) and probably tries to do a bunch of other things --> Minecraft/Sponge doesn’t like this and shuts down the server.

---- Minecraft Crash Report ----

WARNING: coremods are present:
SpongeCoremod (spongeforge-1.8.9-1808-4.1.0-BETA-1237.jar)
Java8CheckerCoremod (Pixelmon-1.8.9-4.2.3-universal.jar)
Contact their authors BEFORE contacting forge

// Daisy, daisy…

Time: 2016-04-05 12:57
Description: Saving entity NBT

java.lang.NullPointerException: Saving entity NBT
at com.pixelmonmod.pixelmon.entities.pixelmon.Entity6CanBattle.getPixelmonWrapper(Entity6CanBattle.java:901)
at com.pixelmonmod.pixelmon.entities.pixelmon.Entity8HoldsItems.func_70014_b(Entity8HoldsItems.java:124)
at com.pixelmonmod.pixelmon.entities.pixelmon.Entity10CanBreed.func_70014_b(Entity10CanBreed.java:132)
at com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon.func_70014_b(EntityPixelmon.java:369)
at net.minecraft.entity.Entity.func_70109_d(Entity.java:1388)
at org.spongepowered.common.entity.SpongeEntitySnapshotBuilder.from(SpongeEntitySnapshotBuilder.java:139)
at net.minecraft.entity.Entity.createSnapshot(Entity.java:306)
at org.spongepowered.common.event.CauseTracker.handleEntitySpawns(CauseTracker.java:338)
at org.spongepowered.common.event.CauseTracker.handlePostTickCaptures(CauseTracker.java:515)
at net.minecraft.world.World.redirect$onCallEntityUpdate$0(World.java:289)
at net.minecraft.world.World.func_72866_a(World.java:1862)
at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:700)
at net.minecraft.world.World.func_72870_g(World.java:1831)
at net.minecraft.world.World.func_72939_s(World.java:1663)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:545)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:701)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:344)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:605)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:481)
at java.lang.Thread.run(Unknown Source)

A detailed walkthrough of the error, its code path and all known details is as follows:

– Head –
Stacktrace:
at com.pixelmonmod.pixelmon.entities.pixelmon.Entity6CanBattle.getPixelmonWrapper(Entity6CanBattle.java:901)
at com.pixelmonmod.pixelmon.entities.pixelmon.Entity8HoldsItems.func_70014_b(Entity8HoldsItems.java:124)
at com.pixelmonmod.pixelmon.entities.pixelmon.Entity10CanBreed.func_70014_b(Entity10CanBreed.java:132)
at com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon.func_70014_b(EntityPixelmon.java:369)

– Entity being saved –
Details:
Entity Type: pixelmon.Pixelmon (com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon)
Entity ID: 645
Entity Name: Totodile
Entity’s Exact location: -122,56, 71,00, 504,62
Entity’s Block location: -123,00,71,00,504,00 - World: (-123,71,504), Chunk: (at 5,4,8 in -8,31; contains blocks -128,0,496 to -113,255,511), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Entity’s Momentum: 0,00, 0,00, 0,00
Entity’s Rider: ERROR NullPointerException: null
Entity’s Vehicle: ERROR NullPointerException: null
Stacktrace:
at net.minecraft.entity.Entity.func_70109_d(Entity.java:1388)
at org.spongepowered.common.entity.SpongeEntitySnapshotBuilder.from(SpongeEntitySnapshotBuilder.java:139)
at net.minecraft.entity.Entity.createSnapshot(Entity.java:306)
at org.spongepowered.common.event.CauseTracker.handleEntitySpawns(CauseTracker.java:338)
at org.spongepowered.common.event.CauseTracker.handlePostTickCaptures(CauseTracker.java:515)
at net.minecraft.world.World.redirect$onCallEntityUpdate$0(World.java:289)
at net.minecraft.world.World.func_72866_a(World.java:1862)
at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:700)
at net.minecraft.world.World.func_72870_g(World.java:1831)

– Entity being ticked –
Details:
Entity Type: pixelmon.Trainer (com.pixelmonmod.pixelmon.entities.npcs.NPCTrainer)
Entity ID: 17
Entity Name: 0
Entity’s Exact location: -122,50, 71,00, 502,50
Entity’s Block location: -123,00,71,00,502,00 - World: (-123,71,502), Chunk: (at 5,4,6 in -8,31; contains blocks -128,0,496 to -113,255,511), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Entity’s Momentum: 0,00, -0,08, 0,00
Entity’s Rider: ERROR NullPointerException: null
Entity’s Vehicle: ERROR NullPointerException: null
Stacktrace:
at net.minecraft.world.World.func_72939_s(World.java:1663)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:545)

– Affected level –
Details:
Level name: world
All players: 1 total; [EntityPlayerMP[‘salmjak’/131, l=‘world’, x=-122,56, y=71,00, z=504,62]]
Chunk stats: ServerChunkCache: 486 Drop: 0
Level seed: 3274383400553683167
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options:
Level spawn location: -127,00,64,00,475,00 - World: (-127,64,475), Chunk: (at 1,4,11 in -8,29; contains blocks -128,0,464 to -113,255,479), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Level time: 436909 game time, 60820 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 1 (now: false), thunder time: 1 (now: false)
Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
Stacktrace:
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:701)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:344)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:605)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:481)
at java.lang.Thread.run(Unknown Source)

– System Details –
Details:
Minecraft Version: 1.8.9
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_77, Oracle Corporation
Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 1164617512 bytes (1110 MB) / 2187329536 bytes (2086 MB) up to 3817865216 bytes (3641 MB)
JVM Flags: 2 total; -Xms512M -Xmx4G
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP 9.19 Powered by Forge 11.15.1.1808 10 mods loaded, 10 mods active
States: ‘U’ = Unloaded ‘L’ = Loaded ‘C’ = Constructed ‘H’ = Pre-initialized ‘I’ = Initialized ‘J’ = Post-initialized ‘A’ = Available ‘D’ = Disabled ‘E’ = Errored
UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forge.jar)
UCHIJAAAA Forge{11.15.1.1808} [Minecraft Forge] (forge.jar)
UCHIJAAAA sponge{DEV} [SpongeForge] (spongeforge-1.8.9-1808-4.1.0-BETA-1237.jar)
UCHIJAAAA pixelmon{4.2.3} [Pixelmon] (Pixelmon-1.8.9-4.2.3-universal.jar)
UCHIJAAAA ivsevs{4.1.0} [IVsEVs] (Evs-Ivs-1.8.9-4.1.0-universal.jar)
UCHIJAAAA itemfinder{2.1.0} [ItemFinder] (ItemFinder-1.8.9-2.1.0-universal.jar)
UCHIJAAAA pixelextras{2.1.1} [Pixel Extras] (PixelExtras-1.8.9-2.1.1-universal.jar)
UCHIJAAAA wondertrade{4.1.1} [Wonder Trade] (WonderTrade-1.8.9-4.2.0-universal.jar)
UCHIJAAAA worldedit{6.1.1} [WorldEdit] (worldedit-forge-mc1.8.9-6.1.1.jar)
Loaded coremods (and transformers):
SpongeCoremod (spongeforge-1.8.9-1808-4.1.0-BETA-1237.jar)
org.spongepowered.common.launch.transformer.SpongeSuperclassTransformer
Java8CheckerCoremod (Pixelmon-1.8.9-4.2.3-universal.jar)

Profiler Position: N/A (disabled)
Player Count: 1 / 50; [EntityPlayerMP['salmjak'/131, l='world', x=-122,56, y=71,00, z=504,62]]
Is Modded: Definitely; Server brand changed to 'fml,forge,sponge'
Type: Dedicated Server (map_server.txt)

Pixelmon and Sponge do not have a good relationship… Good luck :wink:

Really? :open_mouth: Considering that all of pixelmons side-mods have instructions for specifically sponge I would have thought otherwise…

1 Like

I don’t mean the dev teams, sorry to confuse.

I mean the code… pixelmon does some stuff that the sponge code doesn’t like, and vice a versa.

Yeah, I interpreted your reply as a little of both :slight_smile: (Mostly because I’ve read some “hostile” posts about Pixelmon on this forum while googling :P)

Just saying that it’s weird since Pixelmon seems to send out the message that “Hey, it’s OK to use sponge. It should work well.” by including it in their wiki instead of refraining the usage of sponge by not including instructions for it.
Although, incompabilities are nothing weird.

Well I think one of the things is that pixelmon is so massive that it helps find bugs in sponge just by being used… :slight_smile:

It’s supposed to work, but bugs exist on both sides…

3 Likes

Pixelmon and Sponge (the teams) have a good relationship. The mods however tend to break themselves sometimes, though. Usually Sponge and Pixelmon try to resolve these issues asap.

2 Likes

This is a pixelmon issue. They’re not checking for null when saving a “pixelmon.Trainer”
There is also another thread with the same error

1 Like

Asked about it on skype and another dev has it fixed for 4.2.4, thanks @simon816 for clarifying :slight_smile: