mojira.dev
MC-19232

Shift-double clicking (while holding an item stack) to move item stacks to the hotbar actually moves items from the hotbar

The five attached screenshots do a good job of explaining part of the problem. Here are reproduction steps for a more complete representation:

1. /clear
2. Put 2 stacks of stone in your inventory and 2 stacks of stone in your hotbar
3. Grab any other item, perhaps a grass block, and shift-double-click one of the stacks of stone in your inventory with it

Expected: 4 stacks of stone in the hotbar. Actual: 4 stacks of stone in the inventory.

MC-13289 suggests that this is indeed a bug.

Linked issues

Attachments

Comments 13

Does MC-13289 describe your issue ?
If not, please attach screenshots.

no it doesn't in my opinion, I added screenshots with texts. I hope you can understand it.

Hm, then either this ticket or MC-13289 is working as intended.

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

3 more comments

Confirmed for 1.13.1.

Confirmed in 1.15.2 and 20w21a.

This happens because this logic in AbstractContainerScreen.mouseReleased assumes that the slots belonging to the same “quick move group” as the targeted slot can be found by finding all slots belonging to the same container, when in the player inventory the two groups, being the 9x3 inventory and the hotbar, are both part of the player inventory:

					for (Slot $$6 : this.menu.slots) {
						if ($$6 != null
							&& $$6.mayPickup(this.minecraft.player)
							&& $$6.hasItem()
							&& $$6.container == $$1.container
							&& AbstractContainerMenu.canItemQuickReplace($$6, this.lastQuickMoved, true)) {
							this.slotClicked($$6, $$6.index, $$0.button(), ClickType.QUICK_MOVE);
						}
					}

As a result the code will always trigger a “shift click” on all items of the given type in both the inventory and the botbar, regardless of where you click. The actual shift click behavior in the container menu implementations on the other hand is hardcoded to move items from certain slot ranges to others, without regard for Slot.container.

vis

[Mod] redstonehelper

(Unassigned)

Confirmed

Platform

Low

Inventory, UI

chest, dubble, dubbleclick, hotbar, inventory, itmeclick, shift, shiftclick

Snapshot 13w26a, Minecraft 1.6, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 14w08a, ..., 20w46a, 20w51a, 21w07a, 1.20.4, 24w06a

Retrieved