public void writeEntityToNBT(NBTTagCompound nbttagcompound) { super.writeEntityToNBT(nbttagcompound); nbttagcompound.setTag("Inventory", inventory.writeToNBT(new NBTTagList())); nbttagcompound.setInteger("Dimension", dimension); nbttagcompound.setBoolean("Sleeping", sleeping); nbttagcompound.setShort("SleepTimer", (short) sleepTimer); nbttagcompound.setFloat("XpP", currentXP); nbttagcompound.setInteger("XpLevel", playerLevel); nbttagcompound.setInteger("XpTotal", totalXP); if (playerSpawnCoordinate != null) { nbttagcompound.setInteger("SpawnX", playerSpawnCoordinate.posX); nbttagcompound.setInteger("SpawnY", playerSpawnCoordinate.posY); nbttagcompound.setInteger("SpawnZ", playerSpawnCoordinate.posZ); } foodStats.writeStatsToNBT(nbttagcompound); capabilities.writeCapabilitiesToNBT(nbttagcompound); }