This behavior was introduced in 26.1-snapshot-3.
The bug
When viewing the tooltip of a bundle containing an item stack with incompatible data, the game tends to render an empty item stack, causing it to crash with the following error:
The game crashed: rendering screen
Error: java.lang.IllegalStateException: Stack must be non-empty
Steps to reproduce
Create an item stack with incompatible data and put it into a bundle, or create a bundle containing an item stack with incompatible data. This can be done …
… with an item stack that has a
max_stack_itemvalue different from1and also has themax_damagecomponent.
One way to obtain such an item is to use the following command above a chest containing an item with themax_damagecomponent.data modify block ~ ~-1 ~ Items[0].components merge value {"minecraft:max_stack_size":99}… with an item stack that has a count greater than the
max_stack_itemcomponent.
One way to obtain such a bundle is to use the following command above a chest containing a bundle with an item with themax_stack_itemcomponent less thanvalue.data modify block ~ ~-1 ~ Items[0].components."minecraft:bundle_contents"[0].count set value <value>
Hover the mouse cursor over the bundle.
Additional notes
The attached video shows some OBS Studio freezes and a cut between the first crash and opening the world again; neither corresponds to a bug in the game.
Linked issues
is duplicated by 2
Attachments
Comments 9
Reproduced in 26.1-snapshot-5. Upon placing the bundle back into the chest it crashed the game and gave this error:
(Sorry for the small video I didn’t fully open the window.)
Can confirm in 26.1.2. My inventory is a minefield. On my favorite creative server, the custom items I create with ‘/data modify’ seem to be big offenders of this bug. If stackable-damagable items never appear in vanilla, why make them invalid at all? It seems like that would be the easiest fix, just allowing them to exist in any context even with strange behavior.
A simpler command can trigger this issue:
/give @s bundle[minecraft:bundle_contents=[{id:"minecraft:diamond_sword",count:10,components:{"minecraft:damage":1,"minecraft:max_damage":10,"minecraft:max_stack_size":10}}]]I had a world in 1.21.11, and when I updated it to 26.1 my game crashed hovering over the bundle. This is a really OP item on anarchy creative servers (I told someone about it and they proceeded to save it in their hotbars like I did and say they might crash other ppl)
Thank you for helping us improve Minecraft! We saved your files: