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
is duplicated by
relates to
Comments


Confirmed also for 1.4.4

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.

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.

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.

Can confirm. Video link: http://www.youtube.com/watch?v=NaivsG1DZpU

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.

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?

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.

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

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.

Confirmed for 14w18b.

Confirmed for 14w25b

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

Confirmed in 1.8.1-pre4.

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.
Confirmed for 1.8.3 Singleplayer.

Confirmed for 1.8.4, 1.8.5 and 1.8.6.

Confirmed for 15w32b.

confirmed 15w32c
Confirmed for 15w34b
Confirmed for 15w37a

Confirmed for 15w39b, but does not always happen.

Still present in 15w40b

Still happening in 15w41b

Confirmed for 15w42a

Can confirm for 15w42a

Confirmed for 15w43b and 15w43c

Confirmed for 15w44a and 15w44b

Confirmed for 15w45a

Confirmed for 15w46a

Confirmed for 15w47a and 15w47c
Confirmed for 15w49b.

Confirmed for 16w06a

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).

still persistent in 1.9.2
Still in 1.9.4

Confirm 1.9.4.
https://gyazo.com/429bf157638f50a8c04b0673c7dcc1f1
Confirmed for 16w20a
Still in 16w21a and 16w21b
Still in 1.10-pre1
Still in 1.10

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
Odd, I can reproduce using the same steps you're using.

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.

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

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

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

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.

They're already marked as related, so it doesn't really matter that much.
Still happens in 16w33a.
Still in 16w35a.
Still in 16w38a.

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.

Fixed in 16w40a.

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

Nope, not fixed in 16w41a. Seems to appear a bit less, but it's not fixed.
Do you have any steps on how to reproduce it in 16w41a? Because I can't reproduce it since 16w40a... Thank you!

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.
@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.

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.
Also cannot reproduce. @unknown, does MC-341 describe your issue?

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.

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.
@unknown, that looks like MC-5694.
Can confirm.