Like in MC-91883, I'm just going to provide steps to reproduce:
1. /gamemode survival
2. /clear
3. /item replace entity @p armor.head with minecraft:carved_pumpkin
4. /item replace entity @p hotbar.1 with minecraft:carved_pumpkin 32
5. /item replace entity @p hotbar.2 with minecraft:carved_pumpkin 32
5. Open your inventory, move your mouse over the pumpkin in the helmet slot
6. Hit 2 on your keyboard and observe how item stack sizes in your hotbar do not change.
7. Hit 3 on your keyboard and observe how item stack size increases in the second hotbar slot and decreases in the first hotbar slot.
What's actually happening is: When using the 1-9 hotkey, it switches the item stacks between the two slots. Stack size limitation for the helmet slot dictates that only one item may move there, so only one of the 32 pumpkins is moved there, resulting in 31 pumpkins. Then the single pumpkin that was originally in the head slot is moved into the inventory: a slot for it is looked for because the slot we are hotkeying in is still occupied with 31 pumpkins. The game looks through the inventory to find a suitable spot for the single pumpkin to put in (a suitable slot is either an empty slot or a slot the pumpkin can be added to), finds the slot with 31 pumpkins in it and puts the pumpkin there.
The "problem" lies with the order in which a slot is looked for: The 9 hotbar slots are always searched left-to-right. This is why, when we pressed the 2
key, the stack sizes remained the same (the pumpkin from the helmet slot was put in the same slot where the other pumpkin went), and when we pressed the 3
key, the stack sizes changed (the pumpkin from the helmet slot went into the 2nd hotbar slot, the pumpkin that was put into the helmet slot came from the 3rd hotbar slot).
The item "to the left" of the hotkeyed stack can also be in the offhand.
Linked issues
Comments 13
Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time.
This is still replicable by using carved pumpkins instead of pumpkins. I've updated the description to reflect it and also use the new /replace
syntax.
Here are the updated command usages for the third, fourth, and fifth reproduction steps:
/item replace entity @p armor.head with minecraft:carved_pumpkin
/item replace entity @p hotbar.1 with minecraft:carved_pumpkin 32
/item replace entity @p hotbar.2 with minecraft:carved_pumpkin 32
Can confirm for 1.9.