The Bug:
If you change any controls to Button 1, 2, 3, etc., you won't be able to use them inside of the inventory.
Steps to Reproduce:
Rebind
Attack/Destroy
to any unused button.Rebind
Drop Selected Item
to the mouse button.Try to use this button.
→ ✔ It drops items as expected.Open your inventory and try to use the button.
→ ❌ It won't drop any items.
Note: Due to MC-91315, you can only use Drop Selected Items
, Hotbar Slot #
, and Open/Close Inventory
to reproduce.
Code Analysis:
Code analysis by @unknown can be found in this comment.
Related issues
is duplicated by
relates to
Comments


Confirmed in 1.5.1.

Yeah just found this in 1.6 (My issue was apparently a duplicate, it redirected here).

Still not fixed in 13w38c, even after the devs revamped the whole controls menu !

Zombie, just because they rewrote the menu doesn't mean they changed how controls are recognized.

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

Confirmed for 14w18b.

Still reproduceable in 14w32d

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

No response for over a year.

Confirmed for 1.10 and pretty much everything in between.
If this gets fixed, would a switch of left and right click make it so that right click is used for picking up and putting down stacks and left click would split them? Because I like it how it is now. But I don't think it's intended, because it's not at all possible to remap inventory keys this way. A fix that's good for both would require extra keys for that and that again would require a change of the key system of Minecraft. Maybe ignoring conflicts and just triggering both actions if there is one key selected for two actions.

Confirmed for 1.10.1.


Confirmed in 1.12.

Confirmed in 1.12.1-pre1.

Present in 1.13.1

Present in 1.15.2 still

confirmed in 20w16a

Confirmed in 1.16-pre2.

Confirmed in 1.16-pre5.

Confirmed in 1.16-pre7.

1,16,5 still has this issue
Basically this bug means that in inventory screen controls binded to mouse buttons dont work. Tried to play minecraft using only mouse, and stuck immediately because you cant close inventory if its binded to mouse key

1.17 still not fixed.
(Luckily Java edition is moddable)

This bug was reported almost ten years ago and is still an issue in release 1.20.4. It's easy to fix; all that has to be changed to correct the bug is to add these two if statements/branches to the method checkHotbarMouseClicked
inside the AbstractContainerScreen
class.
Edit: Updated the code snippet with things that I have noticed since initially writing this
// Add this to the beginning of the method
if (this.minecraft.options.keyInventory.matchesMouse(button)) {
this.onClose();
return;
// Add this to the first nested if statement
} else if (this.minecraft.options.keyDrop.matchesMouse(button)) {
this.slotClicked(this.hoveredSlot, this.hoveredSlot.index, hasControlDown() ? 1 : 0, ClickType.THROW);
return;

Can confirm in 23w03a

Can confirm in 23w04a

Can confirm in 23w06a

It's hard to believe that this bug still after all the time I spent playing this game. I mean, I don't remember any version when this feature worked well. I understand that many people don't have the need of change keybinds to the mouse, but is very uncomfortable for all the players that have to whatever the reason

Also affects 24w14a.
confirmed, looks like the "select half" option is hardwired to button 2 and isn't remapped with the use item binding.