Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-269680

Game crashes when trying to save after modifying item stack to have a max_stack_size below its current stack size


    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.20.5 Pre-Release 1
    • 24w12a, 24w13a, 24w14a
    • None
    • Confirmed
    • Commands, Items
    • Very Important
    • Platform

      When modifying an item stack to have a maximum stack size below its current stack size the game crashes the next time it tries to save.

      How to reproduce:

      1. Give yourself a stack of stone (/give @s minecraft:stone 64) and select it in your hotbar.
      2. Modify the max_stack_size component to 32:
      /item modify entity @s weapon {function:set_components, components: {"minecraft:max_stack_size":32}}
      3. Notice the chat message: "Can't deliver chat message, check server logs: Replaced a slot on <playername> with [Stone]". The game logs are attached
      4. Pause the game to cause it to save.
      5. The game crashes. The crash log is attached.


      Note that when you split up the stack between steps 3 and 4 to be below the new max_stack_size, the crash does not happen and the stacks do have the new max_stack_size.

            gegy1000 [Mojang] Gegy
            CC_fan jacobsjo
            4 Vote for this issue
            1 Start watching this issue