mojira.dev
MC-123053

Game crashes when using an item with a tag in the CanDestroy or CanPlaceOn NBT tag

The bug

An item that has a block tag (like #minecraft:planks) in the CanPlaceOn or CanDestroy NBT tag, can crash the game. This can happen in two ways:

  • By selecting the hotbar slot the item is in, while being in Adventure mode.

  • By opening the inventory and hovering the mouse over the slot the item is in. This can be circumvented by setting the HideFlags NBT tag to 24, which hides the CanPlaceOn/CanDestroy flag.

The cause of this issue may be that block tags have not been fully implemented for the CanPlaceOn/CanDestroy NBT tag, or that the game does not know how to display the name of a block tag.

How to reproduce

  1. Run either of the following commands:
    /give @s minecraft:stone{CanPlaceOn:["#minecraft:planks"]}
    /give @s minecraft:stone{CanDestroy:["#minecraft:planks"]}

  2. Perform either of the actions listed above. The game crashes immediately.

  3. Reopen the world. It is possible that the item is still selected and the game crashes immediately, or that the item is not selected. It may also occur that the player data is gone.

Crash report

17w50a\: [^crash-2017-12-11_18.29.16-client.txt]

Description: Rendering screen

g: Non [a-z0-9_.-] character in namespace of location: #minecraft:planks
	at mx.<init>(SourceFile:33)
	at mx.<init>(SourceFile:41)
	at atd.a(SourceFile:143)
	at ams.a(SourceFile:681)
	at bqv.a(SourceFile:99)
	at bqv.a(SourceFile:95)
	at brz.a(SourceFile:681)
	at brq.b(SourceFile:176)
	at brz.a(SourceFile:642)
	at bzx.a(SourceFile:997)
	at bne.b(SourceFile:820)
	at bne.a(SourceFile:380)
	at net.minecraft.client.main.Main.main(SourceFile:140)

Linked issues

Attachments

Comments 15

Confirmed in 17w50a.

Also happening in 18w01a.

Still present in 18w05a. On top of that, my player data was deleted when I reloaded the game, which is different.

5 more comments

It crashed because you're in a snapshot. Things may be corrupted or broken in snapshots.

Confirmed for 18w10c

Confirmed for 18w10d
Edit: Oh wait I can just do it myself

Confirmed for 18w11a.

Confirmed for 18w16a

JochCool

michael

Confirmed

CanDestroy, CanPlaceOn

Minecraft 17w49b, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w02a, Minecraft 18w03b, ..., Minecraft 18w10c, Minecraft 18w10d, Minecraft 18w11a, Minecraft 18w14b, Minecraft 18w16a

Minecraft 18w19a

Retrieved