Mojira Archive
MC-114496

Stackable offhand item cannot be shift clicked to stack in offhand

Based on 1.11.2 decompiled using MCP 9.35 rc1

The bug

Introduction: This bug is currently theoretical or may only affect modded Minecraft versions because there are right now no stackable offhand items in vanilla Minecraft.

Shift clicking a stackable offhand item does not move it into the offhand if there is already the same item even if there would be enough space for it.
This is not MC-85216 since offhand items are always moved to the offhand first if there is no item in the offhand and otherwise merged with other inventory items. If MC-85216 is fixed in the expected way the game would probably first try to merge the item with the offhand and therefor this bug could not be seen anymore. However if another slot was added with a higher index or MC-85216 would be fixed in a different way this bug would be still visible.

How to reproduce (modded)

  1. Set net.minecraft.item.Item.maxStackSize for ItemShield to 2
  2. Shift click a single shield
    → The shield is moved to the offhand slot
  3. Shift click a second single shield
    → The second shield is not moved to the offhand slot

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The method net.minecraft.inventory.ContainerPlayer.transferStackInSlot(EntityPlayer, int) will not move an offhand item to the offhand slot if there is already an item.

Awaiting Response

Marcono1234

2017-03-11, 06:10 PM

2018-10-02, 11:25 PM

2018-10-02, 11:25 PM

1

2

Community Consensus

item, off-hand, shift-click, stackable

Minecraft 1.11.2, Minecraft 1.12.1

-