mojira.dev
MC-306072

The game now crashes when viewing the tooltip of a bundle containing an item stack with incompatible data

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

  1. 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_item value different from 1 and also has the max_damage component.

      One way to obtain such an item is to use the following command above a chest containing an item with the max_damage component.

      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_item component.

      One way to obtain such a bundle is to use the following command above a chest containing a bundle with an item with the max_stack_item component less than value.

      data modify block ~ ~-1 ~ Items[0].components."minecraft:bundle_contents"[0].count set value <value>
  2. 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

Attachments

Comments 9

Thank you for helping us improve Minecraft! We saved your files:

[media]

Reproduced in 26.1-snapshot-5. Upon placing the bundle back into the chest it crashed the game and gave this error:

image-20260130-023636.png

(Sorry for the small video I didn’t fully open the window.)

Reproduced in 26.1.1 with a malformed bundle from loading Saved Hotbars.

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.

Reproduced in 26.2 Pre-5

However, it does not crash in version 1.21.11.

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)

Still crashes in 1.26.2
Really annoying bug.

Aloi

(Unassigned)

Confirmed

Platform HC

Normal

Commands, Crash, Items

26.1 Snapshot 5

Retrieved