mojira.dev
MC-114462

Shift clicking ignores stacking restrictions if the same item is already in the slot

The bug

Shift clicking ignores stacking restrictions of a slot if this slot already contains the same item. This does not affect all slots with stacking restrictions because some of them do not use the (probably?) new method Slot.getSlotStackLimit().

How to reproduce

  1. Place a brewing stand

  2. Place a glass bottle in the first potion slot

  3. Place a single glass bottle in your inventory and shift click it
    → You will see that the glass bottle stacked despite the potion slots of a brewing stand only permitting item stacks with a count of 1

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The method net.minecraft.inventory.Container.mergeItemStack(ItemStack, int, int, boolean) ignores the stacking restrictions of a slot if the same item is already in it.

Linked issues

Attachments

Comments 5

Marty McFly

Affects 20w46a

Marty McFly

Affects 21w18a

Marty McFly

Affects 1.17

ampolive

Can confirm in 1.17.1.

Brain81505

Confirm in 1.19.3

marcono1234

(Unassigned)

Confirmed

Items, UI

count, item, shift-click, slot, stacking

Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w18b, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2, ..., 1.19.3 Pre-release 1, 1.19.3, 1.19.4, 1.20.4, 24w09a

Retrieved