mojira.dev
MC-27485

Painting / Item frame spawners crash the game, regardless of data provided

Please don't close this bug as a duplicate of an unrelated report just because it's a spawner crash bug. Not all spawner crashes are caused by invalid EntityIDs - this one has a unique cause unrelated to that.

If a spawner has an EntityID of "Painting", regardless of the provided SpawnData/SpawnPotentials, it will crash the game. This is due to an NBT loading issue, where the game recognizes "Painting" as a valid ID, but attempts to create one with a null world (spawners do this for the entity spinning in the spawner cage).

Unlike the majority of entities, paintings will crash when loading their NBT if their world is null, and there is no workaround to this (not even having an entity ride the painting will fix it).

Steps to Reproduce:

  1. Import the attached schematic into your world.

  2. Observe that you immediately crash when approaching the chunk containing it.

    MC-81578 / 1.8.7

    java.lang.NullPointerException: Saving entity NBT
    	at un.b(SourceFile:187)
    	at uo.b(SourceFile:168)
    	at pk.e(SourceFile:1180)
    	at pk.d(SourceFile:1150)
    	at add.a(SourceFile:129)
    	at add.a(SourceFile:265)
    	at bhh.a(SourceFile:19)
    	at bhh.a(SourceFile:14)
    	at bhh.a(SourceFile:9)
    	at bhc.a(SourceFile:114)
    	at bhc.a(SourceFile:102)
    	at bfr.a(SourceFile:615)

Linked issues

Attachments

Comments

kumasasa
Java Version: 1.7.0_11, Oracle Corporation

Bukkit & way outdated Java...
Gerrard Lukacs: Please get that stuff right.

Neospector

Kumasasa: I was able to reproduce with a vanilla SSP world with updated Java. I want to say it's duplicate of something, but I forget which ticket.

kumasasa

This is strongly related to MC-9788, but that was fixed for 13w09a, maybe only a partial fix.

WolfieMario

The immediate cause of the two crashes differ; MC-9788 seems to be a NullPointerException in the EntityItem class, while this is a NullPointerException in the EntityPainting class.

From what I can tell in Minecraft Coder Pack, this is the cause:

public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
    {
        par1NBTTagCompound.setString("Motive", this.art.title);
        super.writeEntityToNBT(par1NBTTagCompound);
    }

Spawners call this method when attempting to load NBT data into a painting. Essentially, the spawner creates a dummy tag, tries loading the existing data into it with the above method, and then merges the contents of SpawnData (if any exists) into the dummy tag. The problem is, that method makes the assumption that the painting's Motive (the art it displays) has already been defined. The crash happens before SpawnData even has a chance to define it.

From what I can tell, the reason this bug also existed for items is pretty similar: the Item entity's writeEntityToNBT method would assume its item has been defined, before SpawnData was even given a chance to define it. The fix was to only write the item if it already exists (i.e. "if (this.getEntityItem() != null)", in MCP).

Also, apparently for some reason my computer was stuck using an older version of Java. I uninstalled; hopefully it'll use the right one now.

Talven81

Is this still a concern in the current Minecraft version 1.7.2 / Launcher version 1.3.4 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Ezekiel

This ticket is incomplete without the requested information, no response has been received within a reasonable time and we are assuming the issue has been resolved. If you are still experiencing this issue, we can reopen it at your request.
Please review the guidelines before reporting issues.

WolfieMario

Excuse me, but what was the requested information? Mod Talven requested me to update the Affected Versions for 1.7.2 on 27/Nov/13 2:55 PM, and I did so by 30/Nov/13 6:40 PM. That time frame seems reasonable to me; should I have also posted a comment confirming that I've updated the tag?

I wasn't asked for 1.7.4, but rather 1.7.2. Sorry, but I haven't had the time to check all my tickets for 1.7.4. At any rate, I've updated it for that.

Jeuv

Still in 14w02c, but with a different crash.

Itouch2

Can confirm in 14w08a with /setblock ~ ~ ~ mob_spawner 0 replace {EntityId:Painting}

Itouch2

Still a concern in 14w10x

raz

On 1.8.1

Sonicwave

Related to MC-66298.

marcono1234

Confirmed for ItemFrames and Paintings

  • 1.8.5

  • 1.8.6

  • 15w34d

Duplicated by

Cannot confirm for Items

Like the reporter said it might be caused because the game can't render it. This makes sense as changing the TileX, TileY or TileZ value causes Minecart to teleport the ItemFrame/Painting to this position.

One thing interesting to note is that trying to set TileX, TileY or TileZ manually results in a crash of the (internal) server.

Client crash report (no TileX, TileY and TileZ)

---- Minecraft Crash Report ----
// Daisy, daisy...

Time: 24.08.15 15:20
Description: Saving entity NBT

java.lang.NullPointerException: Saving entity NBT
	at wt.b(SourceFile:187)
	at wu.b(SourceFile:175)
	at qx.e(SourceFile:1231)
	at qx.d(SourceFile:1190)
	at agf.a(SourceFile:127)
	at agf.a(SourceFile:260)
	at bmk.a(SourceFile:19)
	at bmk.a(SourceFile:14)
	at bmk.a(SourceFile:9)
	at bmf.a(SourceFile:116)
	at bmf.a(SourceFile:104)
	at bkh.a(SourceFile:624)
	at bka.a(SourceFile:1253)
	at bka.b(SourceFile:1158)
	at bka.a(SourceFile:1005)
	at azi.av(SourceFile:905)
	at azi.a(SourceFile:328)
	at net.minecraft.client.main.Main.main(SourceFile:125)


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

-- Head --
Stacktrace:
	at wt.b(SourceFile:187)
	at wu.b(SourceFile:175)

-- Entity being saved --
Details:
	Entity Type: ItemFrame (wu)
	Entity ID: 35222
	Entity Name: entity.ItemFrame.name
	Entity's Exact location: 0,00, 0,00, 0,00
	Entity's Block location: 0,00,0,00,0,00 - World: (0,0,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,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 qx.e(SourceFile:1231)
	at qx.d(SourceFile:1190)
	at agf.a(SourceFile:127)
	at agf.a(SourceFile:260)
	at bmk.a(SourceFile:19)
	at bmk.a(SourceFile:14)
	at bmk.a(SourceFile:9)

-- Block Entity Details --
Details:
	Name: MobSpawner // aox
	Block type: ID #52 (tile.mobSpawner // ali)
	Block data value: 0 / 0x0 / 0b0000
	Block location: World: (-473,57,-506), Chunk: (at 7,3,6 in -30,-32; contains blocks -480,0,-512 to -465,255,-497), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
	Actual block type: ID #52 (tile.mobSpawner // ali)
	Actual block data value: 0 / 0x0 / 0b0000
Stacktrace:
	at bmf.a(SourceFile:116)
	at bmf.a(SourceFile:104)
	at bkh.a(SourceFile:624)
	at bka.a(SourceFile:1253)
	at bka.b(SourceFile:1158)

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [bjn['Marcono1234'/0, l='MpServer', x=-469,65, y=56,00, z=-507,16]]
	Chunk stats: MultiplayerChunkCache: 625, 625
	Level seed: 0
	Level generator: ID 01 - flat, ver 0. Features enabled: false
	Level generator options: 
	Level spawn location: -469,00,4,00,-501,00 - World: (-469,4,-501), Chunk: (at 11,0,11 in -30,-32; contains blocks -480,0,-512 to -465,255,-497), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
	Level time: 673640 game time, 1449 day time
	Level dimension: 0
	Level storage version: 0x00000 - Unknown?
	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
	Forced entities: 1 total; [bjn['Marcono1234'/0, l='MpServer', x=-469,65, y=56,00, z=-507,16]]
	Retry entities: 0 total; []
	Server brand: vanilla
	Server type: Integrated singleplayer server
Stacktrace:
	at bho.a(SourceFile:359)
	at azi.b(SourceFile:2312)
	at azi.a(SourceFile:337)
	at net.minecraft.client.main.Main.main(SourceFile:125)

-- System Details --
Details:
	Minecraft Version: 15w34d
	Operating System: Windows 7 (amd64) version 6.1
	Java Version: 1.8.0_25, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 151215816 bytes (144 MB) / 363446272 bytes (346 MB) up to 1060372480 bytes (1011 MB)
	JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	Launched Version: 15w34d
	LWJGL: 2.9.4
	OpenGL: AMD Radeon HD 6800 Series GL version 4.5.13399 Compatibility Profile Context 15.200.1062.1004, ATI Technologies Inc.
	GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

	Using VBOs: Yes
	Is Modded: Probably not. Jar signature remains and client brand is untouched.
	Type: Client (map_client.txt)
	Resource Packs: 
	Current Language: English (US)
	Profiler Position: N/A (disabled)
	CPU: 6x AMD Phenom(tm) II X6 1055T Processor

Sever crash report (TileX, TileY and TileZ)

---- Minecraft Crash Report ----
// Quite honestly, I wouldn't worry myself about that.

Time: 24.08.15 15:24
Description: Saving entity NBT

java.lang.NullPointerException: Saving entity NBT
	at wt.b(SourceFile:187)
	at wu.b(SourceFile:175)
	at qx.e(SourceFile:1231)
	at qx.d(SourceFile:1190)
	at agf.a(SourceFile:127)
	at agf.c(SourceFile:102)
	at aox.c(SourceFile:58)
	at ago.k(SourceFile:1319)
	at ll.k(SourceFile:505)
	at net.minecraft.server.MinecraftServer.D(SourceFile:625)
	at net.minecraft.server.MinecraftServer.C(SourceFile:553)
	at bux.C(SourceFile:152)
	at net.minecraft.server.MinecraftServer.run(SourceFile:457)
	at java.lang.Thread.run(Thread.java:745)


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

-- Head --
Stacktrace:
	at wt.b(SourceFile:187)
	at wu.b(SourceFile:175)

-- Entity being saved --
Details:
	Entity Type: ItemFrame (wu)
	Entity ID: 78093
	Entity Name: entity.ItemFrame.name
	Entity's Exact location: -470,25, 58,00, -504,35
	Entity's Block location: -471,00,58,00,-505,00 - World: (-471,58,-505), Chunk: (at 9,3,7 in -30,-32; contains blocks -480,0,-512 to -465,255,-497), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
	Entity's Momentum: 0,00, 0,00, 0,00
	Entity's Rider: ~~ERROR~~ NullPointerException: null
	Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Stacktrace:
	at qx.e(SourceFile:1231)
	at qx.d(SourceFile:1190)
	at agf.a(SourceFile:127)
	at agf.c(SourceFile:102)
	at aox.c(SourceFile:58)

-- Block entity being ticked --
Details:
	Name: MobSpawner // aox
	Block type: ID #52 (tile.mobSpawner // ali)
	Block data value: 0 / 0x0 / 0b0000
	Block location: World: (-470,57,-506), Chunk: (at 10,3,6 in -30,-32; contains blocks -480,0,-512 to -465,255,-497), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
	Actual block type: ID #52 (tile.mobSpawner // ali)
	Actual block data value: 0 / 0x0 / 0b0000
Stacktrace:
	at ago.k(SourceFile:1319)
	at ll.k(SourceFile:505)

-- Affected level --
Details:
	Level name: Test World
	All players: 1 total; [lm['Marcono1234'/0, l='Test World', x=-470,80, y=56,00, z=-503,06]]
	Chunk stats: ServerChunkCache: 625 Drop: 0
	Level seed: -8683367614062884530
	Level generator: ID 01 - flat, ver 0. Features enabled: true
	Level generator options: 3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;
	Level spawn location: -469,00,4,00,-501,00 - World: (-469,4,-501), Chunk: (at 11,0,11 in -30,-32; contains blocks -480,0,-512 to -465,255,-497), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
	Level time: 674588 game time, 1449 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: creative (ID 1). Hardcore: false. Cheats: true
Stacktrace:
	at net.minecraft.server.MinecraftServer.D(SourceFile:625)
	at net.minecraft.server.MinecraftServer.C(SourceFile:553)
	at bux.C(SourceFile:152)
	at net.minecraft.server.MinecraftServer.run(SourceFile:457)
	at java.lang.Thread.run(Thread.java:745)

-- System Details --
Details:
	Minecraft Version: 15w34d
	Operating System: Windows 7 (amd64) version 6.1
	Java Version: 1.8.0_25, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 211541264 bytes (201 MB) / 365826048 bytes (348 MB) up to 1060372480 bytes (1011 MB)
	JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	Profiler Position: N/A (disabled)
	Player Count: 1 / 8; [lm['Marcono1234'/0, l='Test World', x=-470,80, y=56,00, z=-503,06]]
	Type: Integrated Server (map_client.txt)
	Is Modded: Probably not. Jar signature remains and both client + server brands are untouched.
SunCat

Confirmed for 1.8.9, fixed for 1.9-pre2

[Mod] redstonehelper

Resolved as fixed, please do re-test in the full 1.9 release and let us know if it's still fixed.

SunCat

Definitely fixed

user-f2760

this was resolved as such for 1.9-pre2...

WolfieMario

(Unassigned)

Community Consensus

crash, painting, spawner

Minecraft 1.6.2, Minecraft 13w37a, Minecraft 1.7.2, Minecraft 13w48b, Minecraft 1.7.4, ..., Minecraft 1.8.1-pre1, Minecraft 1.8.5, Minecraft 1.8.6, Minecraft 1.8.7, Minecraft 1.8.9

Minecraft 1.9 Pre-Release 2

Retrieved