mojira.dev
MC-2912

Creative Mode Hotbar Glitch when using Number Key to exchange items slots

In creative mode, when I place a water bucket (for example) in Hotbar slot, hover above it and press a numberkey to move the it (i.e. to swap it with a dirt block) and then place the water bucket (which is now where the dirt block was and vice versa), it will place dirt. Not water. Placing dirt works as expected. Also works vice versa.

Steps to reproduce:

Example using water bucket
1. Put a water bucket in your hotbar. (i.e. 1st slot)
2. Press any number key (1-9) while hovering over water bucket, except its own slot number. (In this case 1.) Example : Dirt is in 2nd slot so press '2' and swap dirt and water bucket.
3. Place water bucket.
4. Water bucket is seems to be placed and is instantly replaced by dirt.
5. Open inventory to fix problem. If you are holding the water bucket in your hand it will be animated as if it was beeing swapped.

This apparently happens with all blocks. I haven't fully tested yet. It also works with having nothing instead of dirt, then water is placed for a short moment and instantly replaced by air. Also works with potions.


Code analysis by @unknown can be found in this comment

Related issues

MC-3161 Block disappears when placed in creative MC-4541 Items in hotbar disapears after rightclicking dispensers MC-5138 Number Clicking MC-6543 Item Duplication MC-6667 Blocks are disappearing after being placed in creative mode when using some inventory-management shortcuts MC-10722 Ghost Items In Creative MC-12197 Item Duplication in Hotbar and in World MC-15814 Milk Buckets and Item Hot-switching MC-17076 CobbleStone placement glitch MC-17722 Using numbers to quick switch items in your hotbar in creative is buggy MC-17998 when switching bocks on creative in your inv it will show that you switcht until you plase it MC-20027 In Creative Gamemode, if i use number key to change item in hotkey slots, they will get back while i place them. MC-20040 Item duplicates with 1-9 swap keys and overwrites other items MC-21640 Duplication glitch MC-22332 Inventory Bug MC-26696 block duplicating while changing the block with keyboard numbers in inventory (With Video) MC-27579 Items in inventory being deleted MC-35975 changing block inventory spot with numbersq MC-38138 using shortcut with 1-9 in hotbar removes item when try to use it MC-38423 Duplicate items in minecraft 1.7.2 on creative MC-40221 Item switch glitch MC-41616 Using number keys to move items around hotbar causes the game to become confused. MC-42284 Block and Item Duplication/Replacement when switched in inventory MC-42636 Obscure bug causes items to vanish completely from the hotbar MC-44452 Ghost items in creative when moving items with number keys in inventory MC-46872 SERIOUS HOT-BAR BUG MC-46894 Can still break blocks with sword in creative MC-47247 Hotbar Duplication bug MC-50071 Block disapearence MC-50493 Item Glitch in Creative MC-51599 Break Blocks With Sword In Creative MC-52447 Stonme disappears when I place it MC-54743 Inventory 'Ghost Item' Glitch MC-54882 Block dissapearing when shifted in inventory and then placed MC-55696 Moving blocks in creative inventory with number keys MC-57049 Block Duplication Glitch in 14w25a Snapshot MC-63629 Switching a sword with number keys allows it to break blocks in creative MC-74030 Can shoot using arrows using sword MC-75275 Command blocks glitching in hotbar MC-76903 Shooting arrows with the sword MC-82214 Creative Hotbar Swapping Bug MC-84713 Switching Items in Hotbar by Keyboard MC-85303 Using Number Keys to Switch Items in Hotbar in Creative Places the Wrong Blocks - read on. MC-85553 Problem with switching items in inventory with number keys MC-86653 Switching blocks within creative hotbar using numkeys only switches graphic MC-86982 Dragon Head Placement w/ No Item Selected MC-87202 the problem with rolled items in the inventory MC-87614 Hotbar Bug MC-90276 Hoe Bug. MC-91870 Spawn egg acts like item you swap with! MC-92206 Using numbers to move objects in hotbar in Creative inventory glitches. MC-92248 Swap Items Bug - 15w45a MC-92654 Selected Item's Attribute Modifiers Not Applying MC-94117 Creative quick slots bug MC-94539 Sword Destroy Block In Creative MC-96085 Bow Glitch MC-97041 Sword Bug MC-99099 Inventory Update (moving items with # keys) MC-99326 Switching items with the number keys updates client side, but not server side. MC-99551 Bug when swap items in creative mode MC-102349 Can break blocks in creative w/ sword MC-102876 Switching Items in hotbar using numbers causes Items to place the wrong block MC-102883 Wrong block placed when hotbar order is changed using shortcut keys MC-103925 bloc placing probleme while bloc solt number change via keyboard MC-104644 Using hotbar keys can create ghost items MC-104646 Using the 1-9 keys to move blocks in the hotbar break their placeability MC-105890 Minecraft bone meal bug MC-106184 Creative Mode Graphical Item Glitch/Bug MC-106373 Blocks not placing after using 1-9 keys to move items in inventory MC-106491 Block-Switch Placement Bug MC-106736 Ghost Block Command Block Glitch MC-106994 Pressing 1-9 to swap items makes the blocks act weird... MC-108119 Block incorect after rearranging blocks in hotbar using number row MC-108494 Placing wrong block after using hotkeys to move item in hotbar (Creative) MC-108543 Item swap

Comments

CubeTheThird

Can confirm.

kumasasa

Confirmed also for 1.4.4

migrated

When I do it it replaces the current inventory slot with the other one I switched.
EDIT- Doesn't require to to place the block, just right-click (or whatever button you may have it set to.)
EDIT again-I was able to successfully do this in survival, duplicating Emeralds. It took a while, so it may be a phantom glitch.

migrated

Found a reliable way to reproduce in 1.5.1 creative singleplayer.

If you are viewing the survival inventory in creative mode (the bottom-right tab, with the chest icon), using number keys in the hotbar works as expected.

In any other tab of the creative inventory, switching items in the hotbar with number keys causes the following behavior: After exiting the creative inventory, selecting the hotbar slot corresponding to the pressed number key and attempting to use that item (by right-clicking) causes whatever item is in that slot to be replaced with what was in there previously (i.e. before switching). The contents of the slots do not matter (edit: see below), for example if "2" is pressed over an empty hotbar slot, right-clicking with slot 2 selected will effectively "delete" the contents.
Edit: Further testing has shown that hotbar slots 3 and 7 (i.e. pressing the number keys "3" and "7") seem to be unaffected by this bug for whatever reason.
Edit: If a number key is pressed corresponding to a slot, and the item in that slot is a potion or splash potion, the behavior becomes unpredictable, appearing to depend on many different factors: The item is duplicated as described above, but the behavior on right-clicking varies in complicated ways. Items other than (splash) potions in the affected slot seem to follow the rules above.

After switching hotbar items in this manner (using number keys, on any tab other than survival inventory), the following actions will cancel the effect and revert to normal behavior:
-Exiting and re-opening the inventory.
-Further manipulation of items in the inventory, by any means, including mouse action or number keys; however the latter may trigger the bug anew in addition to canceling the previous effect, if not done on the survival inventory tab.

Pressing the same number key on the same slot twice (or any even number of times) will behave as expected, doing nothing to the items.

Example:
In the creative mode inventory, place a lever in hotbar slot 1, and redstone in hotbar slot 2. Open the creative mode inventory and go to the "Building Blocks" tab (top left, with bricks icon; any tab other than the survival inventory will work.) Put the cursor on the redstone and press "1". Visually, the items will appear to have been switched; there will now appear to be a lever in slot 2 and redstone in slot 1. Exit the inventory screen.

Trying to place a lever (now in slot 2) works as expected.
Trying to place redstone (in slot 1) causes a lever to appear in the hotbar in place of the redstone (effectively duplicating the lever), and for all intents and purposes the game acts as if you had a lever in that slot.
Attempting to drop the redstone (by default with Q) drops a lever instead.

migrated

My theory is that it's caused by whatever code makes items not disappear (i.e. be "copied" instead of "moved") when picked up from the upper part of the creative inventory. For some reason, this code is applying to the hotbar slots on these screens too, but only when number keys are used.

Normally, when you are in one of the category tabs in the creative inventory, pressing a number key on a slot in the upper, scrollable part copies a full stack of whatever was selected into the corresponding hotbar slot.

For some reason, when a number key is used on a hotbar slot, the same code is running, causing the item to be duplicated into the specified slot; however, unlike the above behavior, this copies the quantity of the item too, instead of giving a full stack. The client switches the items on the screen, but on the server side what actually took place was a duplication; this doesn't become visible to the player until the client recieves an inventory update.

As for why slots 3 and 7 are unaffected, I have no clue.

migrated
migrated

Extremely strange behavior when I was testing swapping different tools (e.g. bows, swords, empty buckets) but the results weren't consistent.
Swords seem to be the most buggy especially when swapped with a bow.

migrated

Reproduced in 1.7.3!

-In creative, start with an empty inventory, and put a sword as the first item in your hotbar.
-Place a water bucket as the second item. Switch to your sword outside of the inventory.
-Try breaking blocks with the sword (you can't), but you can with the bucket.
-Back in your inventory, hover your mouse over the sword and press 2. Exit your inventory.
-Both will be able to break blocks, but one won't produce sound.

NOTES:The other way around doesn't work (hovering over item 2 and pressing "1"), the bug doesn't work in survival; however, if you do this bug in creative, then switch to survival, if you try picking up the sword in your inventory, it will turn into a bucket of water, and the other bucket of water stays as a bucket of water (you lose the sword). At one point during testing, I ran into another bug, where some blocks were "unloaded", or invisible, and didn't appear until after relog; the only way I could tell they were there was that water wasn't getting to them. Done on Windows 8 (if that makes a difference).

WOW this bug is THAT old? Who knew?

migrated

To the comment above. I have to correct you a little bit on something. If you follow the instructions and DRAG the items, it doesn't work.

Also, when you right click with the sword, it changes into a bucket.

I do confirm that this bug works. And the sword stays a sword, even when you scroll away.

I think the issue is that the game thinks it's a bucket while a sword is displayed.

migrated

This also happens when dropping items from the creative inventory survival tab. Items disappear when dropped from other tabs.

migrated

This is confirmed for the latest snapshot. Please look into it. The way that I reproduce it is by opening up your inventory, hovering over slot 2-9, and pushing one to move it to slot one. When you place that block, it goes back to the block that was there before.

migrated

Confirmed for 14w18b.

migrated

Confirmed for 14w25b

migrated

Confirmed for 1.8, different steps to reproduce:

1. Create new creative world
2. Put a sword in your first hotbar slot
3. While hovering over it, hit the 2 key
4. Close your inventory
5. Hit the "2" key
6. Hit a block - it will be destroyed, which swords are not supposed to do in creative mode

Sonicwave

Confirmed in 1.8.1-pre4.

Sonicwave

Confirmed for 1.8.2-pre1. This makes number key switching useless in Creative mode as they only create hassle instead of helping the player.

violine1101

Confirmed for 1.8.3 Singleplayer.

Sonicwave

Confirmed for 1.8.4, 1.8.5 and 1.8.6.

Sonicwave

Confirmed for 15w32b.

migrated

confirmed 15w32c

[Mod] Neko

Confirmed for 15w34b

[Mod] Neko

Confirmed for 15w37a

migrated

Confirmed for 15w39b, but does not always happen.

migrated

Still present in 15w40b

migrated

Still happening in 15w41b

migrated

Confirmed for 15w42a

migrated

Can confirm for 15w42a

migrated

Confirmed for 15w43b and 15w43c

migrated

Confirmed for 15w44a and 15w44b

migrated

Confirmed for 15w45a

migrated

Confirmed for 15w46a

migrated

Confirmed for 15w47a and 15w47c

violine1101

Confirmed for 15w49b.

SunCat

Confirmed for 16w06a

migrated

Confirmed for 1.9-pre1 and 1.9-pre2.
Also, some weird thing I noticed: the items are actually swapped when closing and opening the inventory (pickup animation plays).

migrated

still persistent in 1.9.2

violine1101

Still in 1.9.4

Ray
[Mod]Les3awe

Confirmed for 16w20a

violine1101

Still in 16w21a and 16w21b

violine1101

Still in 1.10-pre1

violine1101

Still in 1.10

FaRo1

Can't confirm in 1.10.2, although someone else apparently could (duplicate). What do I do wrong?
https://www.dropbox.com/s/ylyvhlsqwaqo87r/2016-06-29%2004-34-51.mp4?dl=0

[Mod] Neko

Odd, I can reproduce using the same steps you're using.

FaRo1

Btw, I was able to reproduce it now. I made another program spam the number keys really, really fast. But I can only reproduce it that way.

FaRo1

Wait, isn't this the same as MC-341, not only related?

migrated

Yeah, I think this is a duplicate of MC-341.

bemoty

Duplicate of MC-341.
Since MC-341 is older than MC-2912, MC-2912 can be resolved then. (I guess)

migrated

It is already marked as related, and resolving this one to that is too much work, really (relinking every single report).

pokechu22

Is it necessary to relink every report? I've seen other tickets which are duplicates but still have other duplicates linked to it. Though it would still be a bit confusing.

migrated

They're already marked as related, so it doesn't really matter that much.

bemoty

Still happens in 16w33a.

violine1101

Still in 16w35a.

violine1101

Still in 16w38a.

marcono1234

Please link to this comment in the description

The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.

The reason for this is probably that the method net.minecraft.client.gui.inventory.GuiContainerCreative.handleMouseClick(Slot, int, int, ClickType) only sends one slot update. The problem in general is that the creative GUI does not use the same inventory mechanics as the survival inventory, which means it has to send a slot update every time instead of having the server do some of the work.

Jayceebee

Fixed in 16w40a.

migrated

It's not fixed in 16w40a, just checked to be sure.

FaRo1

Nope, not fixed in 16w41a. Seems to appear a bit less, but it's not fixed.

Agnes Larsson

Do you have any steps on how to reproduce it in 16w41a? Because I can't reproduce it since 16w40a... Thank you!

FaRo1

I always use an external program to test it. It automatically writes the "text" 1234123412341234..., but it should also be reproducable by rolling your head over the num pad. 😉
Success rate has gone from once every few hundred repetitions of "1234" before 41a to now once every ~3.000 repetitions. Not really a huge issue, but one time I also got it without trying, during normal playing.

violine1101

@unknown I don't fully understand what you want to achieve with typing "123412341234" etc. Can you explain what you're actually doing with your external program? I cannot reproduce this bug anymore either by the way.

FaRo1

Number keys exchange slots. That's what this bug is about. 1, 2, 3 and 4 are number keys.
I just tested and was able to duplicate/delete so much that 3 of 4 slots contained the same item at the end.

[Mod] Neko

Also cannot reproduce. @unknown, does MC-341 describe your issue?

FaRo1

Ok, apparently this is fixed. I was confused by buggy weirdness.
I can't confirm the fix myself, because apparently this is something I never encountered. But if other people say that this is fixed, it apparently is.

migrated

I think this bug has returned in as a deadlier strain, so to speak. Since around 16w40a, I've experienced (albeit rarely) a similar bug in survival. Here's a video I stumbled across of this bug occuring: https://www.youtube.com/watch?v=Oupg58gOiZk (skip to 21:49s). This could possibly be a very detrimental bug, as, as you can see in the video, the block you're trying to place is consumed despite not being placed, and the block that is actually placed is not consumed. If this could be consistently reproduced, this could be a very bad duplication bug. For example, we could "try" to place a block of dirt and instead have a block of diamond placed, with the dirt being taken from the hotbar and the block of diamond not, basically turning dirt to diamond.

[Mod] Neko

@unknown, that looks like MC-5694.

migrated

Agnes Larsson

Confirmed

block, hotbar, numberkey

Minecraft 1.4.2, Minecraft 1.4.4, Snapshot 12w50a, Minecraft 1.4.6, Minecraft 1.4.7, ..., Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w38a, Minecraft 16w39b, Minecraft 16w40a

Minecraft 16w41a

Retrieved