[MC-5415] Creative Mode Item Duplication into hotbar Created: 27/Dec/12  Updated: 19/Jul/24  Resolved: 25/Aug/18

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w01b, Snapshot 13w07a, Snapshot 13w10b, Minecraft 1.5, Minecraft 1.5.2, Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 1.7, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 1.7.4, Minecraft 14w05b, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 1.7.5, Minecraft 14w19a, Minecraft 14w25b, Minecraft 1.7.10, Minecraft 14w32a, Minecraft 14w32b, Minecraft 14w32c, Minecraft 14w32d, Minecraft 1.8-pre2, Minecraft 1.8, Minecraft 1.8.7, Minecraft 15w33b, Minecraft 15w33c, Minecraft 15w39c, Minecraft 15w40b, Minecraft 15w41b, Minecraft 15w42a, Minecraft 15w44b, Minecraft 1.9 Pre-Release 1, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 16w14a, Minecraft 1.9.4, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w42a, Minecraft 16w44a, Minecraft 1.11.2, Minecraft 1.12 Pre-Release 6, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 18w03b
Fix Version/s: Minecraft 1.13.1

Type: Bug
Reporter: Alex Jennings Assignee: Unassigned
Resolution: Fixed Votes: 27
Labels: creative, creative-inventory, drop, duplication, hotbar, inventory, item, slot
Environment:

Windows 7 64bit, Java Version 7 Update 5


Attachments: PNG File 2012-12-27_15.17.31.png     PNG File 2012-12-27_15.17.35.png    
Issue Links:
Duplicate
is duplicated by MC-6789 Inventory restores partly upon openin... Resolved
is duplicated by MC-6832 Dropping items by hovering over an it... Resolved
is duplicated by MC-8546 Creative mode item dupe Resolved
is duplicated by MC-8638 Pressing Q then E in creative makes y... Resolved
is duplicated by MC-9761 New Inventory feature in 1.5 duplicat... Resolved
is duplicated by MC-11303 Hopper "regenerating" items Resolved
is duplicated by MC-11756 Item duplication in creative mode. Resolved
is duplicated by MC-12053 Creative: Items dropped from hotbar s... Resolved
is duplicated by MC-14950 Creative Duplication Resolved
is duplicated by MC-19398 If you press CONTROL + Q in creative ... Resolved
is duplicated by MC-19637 item dupe bug Resolved
is duplicated by MC-22670 Item Duplication (control-Q) Resolved
is duplicated by MC-27069 Double-Click , Delete not working Resolved
is duplicated by MC-28370 Dropped Items Duplication Resolved
is duplicated by MC-29301 Dropping Bug Resolved
is duplicated by MC-30978 In the creative inventory, the items ... Resolved
is duplicated by MC-37311 Inventory Item Duplication possible Resolved
is duplicated by MC-44611 Duplication bug while trading with vi... Resolved
is duplicated by MC-46600 Dupelicating Villager Items Resolved
is duplicated by MC-53161 creative item duplication Resolved
is duplicated by MC-54339 Duplication - drop item Resolved
is duplicated by MC-54868 Glitchy blocks Resolved
is duplicated by MC-58039 Duplication in creative inventory Resolved
is duplicated by MC-59712 Rapid Clicking Item Duplication or De... Resolved
is duplicated by MC-66540 In Superflat Tunnelers Dream Creative... Resolved
is duplicated by MC-68113 Item duplication when dropped from cr... Resolved
is duplicated by MC-71597 item duplication Resolved
is duplicated by MC-81596 Creative item duplication Resolved
is duplicated by MC-82451 Duplicated in Creative Mode Resolved
is duplicated by MC-84795 Dropped items from survival inventory... Resolved
is duplicated by MC-85745 Under some conditions items can dupli... Resolved
is duplicated by MC-86549 Duplicate when dropping items Resolved
is duplicated by MC-87325 Creative Inventory Duplication Resolved
is duplicated by MC-88840 duplication bug Resolved
is duplicated by MC-89503 Duplication glitch with chests Resolved
is duplicated by MC-89732 Dropping item from inventory will dup... Resolved
is duplicated by MC-89982 Dropping an item by pressing Q on inv... Resolved
is duplicated by MC-90023 Right click to equip armor in creativ... Resolved
is duplicated by MC-90643 Creative dupe Glitch Resolved
is duplicated by MC-90931 Pressing 'Q' in inventory does not up... Resolved
is duplicated by MC-91012 Server item duplication Resolved
is duplicated by MC-92039 1 BUG (enchant command) Resolved
is duplicated by MC-92818 Creative Item Duplication Resolved
is duplicated by MC-94058 Duplication of items Resolved
is duplicated by MC-95912 Duplicating and disappearing items on... Resolved
is duplicated by MC-98741 Items duplicate in creative when righ... Resolved
is duplicated by MC-100675 Creative mode item duplication (drop,... Resolved
is duplicated by MC-101534 Holding "Q" and scrolling hotbar "Tem... Resolved
is duplicated by MC-102216 Duplication Bug Resolved
is duplicated by MC-103666 Player renders wearing armour despite... Resolved
is duplicated by MC-105632 Item duplication by throwing off-hand... Resolved
is duplicated by MC-105722 Creative Inventory Duplicates After O... Resolved
is duplicated by MC-106718 63 items duplicate bug Resolved
is duplicated by MC-109552 Bug duplication of items in creative. Resolved
Relates
relates to MC-268431 External inventory changes except for... Resolved
relates to MC-341 Duplication and deletion of hotbar it... Resolved
relates to MC-265640 Moving items before and after switchi... Open
relates to MC-81731 Dropped items are doubled in Creative... Resolved
relates to MC-86455 Pick-block creates ghost items in Cre... Resolved
relates to MC-90058 Dropping Item(s) on floor Resolved
CHK:
Confirmation Status: Confirmed
Game Mode: Creative

 Description   

I was pulling items from the creative inventory to fill chests for making fireworks. When I filled up the survival inventory and exited out, to store them in the chest, I had an item duplicated in the hot bar.

What I expected to happen was...:
there to be a full survival inventory and nothing in the hot bar when I opened the chest.

What actually happened was...:
I had a full survival inventory with a duplicate of the item in the hot bar.

Steps to Reproduce:
1. Open up creative inventory and put any item(I tried it with quite a few items) in your hot bar.
2. Switch to the survival inventory by clicking the chest icon
3. Move the item(s) from the hot bar to the survival inventory
4. Exit out of your inventory.
5. Open a chest
6. There should be a duplicate of the item, that you placed into the survival inventory, in your hot bar.

Notes:
-Moving a block in any direction after exiting from the inventory before opening a chest breaks the bug.
-Where you place the item in the survival inventory has no affect.
-It seems to only duplicate the first item moved from the hot bar to the survival inventory. For example, move a stack of diamonds then a stack of gunpowder to the inventory and only the diamonds will duplicate.
-The location of the item on the hot bar before moving it to the inventory also has no affect.
-Shift clicking or dragging still produces the same bug.
-I know there are other bugs reported for duplicating but they all required repeatedly pushing buttons.


(Old 1.5) code analysis by bugi74: link



 Comments   
Comment by Kumasasa [ 25/Aug/18 ]

Since there are no new reports for this issue coming in, assuming fixed.

Comment by Kraif [ 25/Aug/18 ]

Cannot reproduce for 1.13.1.

Comment by [Mod] bemoty [ 12/Aug/17 ]

Cannot reproduce in 1.12 & 1.12.1, fixed?

Comment by Fabian Röling [ 25/Jun/16 ]

I've just reproduced the second method mentioned in the description in 1.10.2 and also made a video about some more weirdness connected to it:
https://www.dropbox.com/s/akgxf1iqve2pbda/2016-06-25%2022-48-24.mp4

Comment by SunCat [ 08/Jun/16 ]

Still in 1.10-pre2

Comment by Fabian Röling [ 20/Apr/16 ]

Also works the other way around: Take something from the creative inventory (list), don't put it somewhere, but throw it out (hover over the list and press the drop key or click on an item and click outside UI). Pick the item up (doesn't matter if you close the inventory in the meantime). Then switch to the "survival inventory" (still in creative): The item is not there. Open an external inventory, item appears in your inventory.

Comment by Fabian Röling [ 08/Apr/16 ]

It's not necessary to have the items in the hotbar first.

Comment by Fabian Röling [ 08/Apr/16 ]

Confirmed for 1.9.2 and 1.9.1, some people may just search for them (as I did).

Comment by Irritated Gamer [ 14/Mar/16 ]

@Kumasasa I can confirm for 1.9.1 pre 3.

What I have noticed: I continued this until it wouldn't show anymore items in my inventory even though I would pick up items, they don't appear in the inventory. Clearing my inventory /clear @p it said removed 2112 items even though there was nothing there. Pressing ctrl+q hovering the item then picking it up does indeed double it. It will attempt to double a FULL stack which causes the "Invisible entity" items to take up room in the inventory. shift clicking the delete item button gets rid of them as well as /clear @p. Yes only happens in Creative mode, not survival or adventure. IF you remove your visible items, then "invisible" items are gone. The "invisible" items will remain in the inventory until all visible items are deleted or removed. (This means that the game possibly thinks its all ONE stack of items) Happens when viewing inventory in said creative mode. ALSO ctrl+q hovering over the item, then picking back up, then entering a chest, the "invisible" items will appear!!

CONCLUSION: The bug is caused by an attempt to duplicate a FULL stack of items, this includes a water/lava bucket/minecart etc. Since it cannot go above 64, it glitches out and causes these "ghost" entities. Hope this helps!

EDIT: I actually find this glitch useful in that it helps me duplicate items faster than pressing pick block on a single stack. Just saying, it could be turned into a sort of useful feature, in my opinion!

Comment by Immaterialise [ 17/Feb/16 ]

Confirmed for 1.9-pre1

Comment by [Mod] Sonicwave [ 24/Sep/14 ]

Confirmed for 1.8.

Comment by Marcono1234 [ 25/Aug/14 ]

Confirmed for:

  • Minecraft 1.8-pre 2 also the duplication qmagnet is discribing
Comment by qmagnet [ 09/Aug/14 ]

Confirmed for 14w32d. This also works

  • Go into Creative Mode
  • Give yourself 1 item
  • Press E and view Survival Inventory
  • Press Q on the item
  • It drops, but when you pick it up, you always get double

This may be related to MC-23039

Comment by majaha [ 28/Jul/14 ]

I think the point is that there's a mismatch between what you think you've done to the inventory, and what has actually happened to it, rather than an exploit you could use in survival to cheat.

Comment by Why is this Necceccary? [ 28/Jul/14 ]

Yeah, all creative duplication methods could probably be resolved as invalid: you can middle-click it to dupe a full stack of identical copies.

Comment by majaha [ 10/May/14 ]

Actually, you can use pick block (bound by default to middle click) on an item to duplicate it, enchantments and all.

Comment by Tokes [ 10/May/14 ]

If anyone is looking to INTENTIONALLY duplicate items in creative (for example if you have armor/weapons that have just the right enchantments) try one of the following 2 methods (both intentional features rather than bugs):

1) Putting something into an item frame while in creative causes the item to appear in the frame but still be in your hand at the same time (the one in the frame is a dupe). To get it back out of the frame you have to switch back to survival, however you can do this with a bunch of frames so that you're not switching gamemodes back and forth constantly for large numbers of items.

2) The second way is using the feature that lets you put armor into your hotbar and click on it there to equip it. You make it the currently selected item in the hotbar and hit the mouse button. Doing this in creative equips a duplicate of the armor while keeping the original in your hotbar. Doesn't work with non-armor items of course.

Comment by Itouch2 [ 24/Feb/14 ]

Yep, still an issue in 14w08a (and 1.7.4)

Comment by majaha [ 22/Oct/13 ]

Still effects 1.7 prerelease

Comment by WolfieMario [ 11/Aug/13 ]

Considering all methods of creative item duplication have been closed as "duplicates" of this, I'll just throw this one out there:

If you're in the survival inventory tab, in Creative mode, and you Ctrl+Q to drop the item you're hovering over, you'll seem to drop the stack, but in reality you just dropped a duplicate stack. When your inventory updates (e.g. from picking up an item or relogging), you'll see the original stack is still there, and the dropped stack is real and can be picked up.

This is most easily demonstrated by looking straight down and Ctrl+Q-ing items. You'll pick up the duplicate stacks, and it will seem as though you dropped the whole stack and picked up twice as many items.

This bug can also cause inventory desynchronization, where entire stacks in your inventory remain invisible until you re-log.

Comment by Apocalypsing [ 09/Aug/13 ]

Affects 1.6 as well, right up to 1.6.2.

Comment by Markku [ 16/Mar/13 ]

Possible fix
Caveat, working on mostly obfuscated 1.5 code, so I might easily miss something important... Also, difficult to show the fixed code as there is no (good) common MCP naming to refer to at this point. Identifier names now used are my quick and very narrow interpretations/guesses.

GuiContainerCreative
    //             func_74191_a(Slot p_74191_1_, int p_74191_2_, int p_74191_3_, int p_74191_4_)
    protected void handleMouseClick(Slot slot, int slotNumber, int shiftPressed, int clickType) {
        ...
        if (selectedTabIndex == CreativeTabs.tabSurvivalInventory.getTabIndex()) {
            if (slot == this.trashSlot) {
                this.minecraft.player.inventory.setSomeStack((ItemStack) null);
            } else if (clickType == 4 && slot != null && slot.hasStack()) {
                //stack2 = slot.decStackSize(shiftPressed_maybe == 0 ? 1 : slot.getStack().getMaxStackSize());
                //this.minecraft.player.dropExternalStack(stack2);
                //this.minecraft.playerController.setSomeCreativeDefaultSlot(stack2);
                // FIX? Adapted from GuiContainer (normal survival mode operation)
                // obfuscated method name 'func_78753_a'
                this.minecraft.playerController.atLeastContainerEventsUse(this.container.windowId, slotNumber, shiftPressed, 4, this.minecraft.player);
            } ...
    }

    //           func_74227_b(CreativeTabs p_74227_1_)
    private void setCreativeTab(CreativeTabs tab) {
        ...
        if (tab == CreativeTabs.tabSurvivalInventory) {
            ...
            creativeContainer.slots = new ArrayList();
            
            for (int pfcSlotIndex = 0; pfcSlotIndex < playersFullContainer.slots.size(); ++pfcSlotIndex) {
                SlotCreativeInventory specialSlot = new SlotCreativeInventory(this, (Slot) playersFullContainer.slots.get(pfcSlotIndex), pfcSlotIndex);
                creativeContainer.slots.add(specialSlot);
                // FIX? Adapted from Container.addSlotToContainer() (or func_75146_a())
                specialSlot.slotNumber = pfcSlotIndex;
                ...
    }

Changes tested on 1.5, and seems to work as expected. Didn't look for side-effects, and didn't test full multiplayer.

While at it, I'd give another look at the code right below the now fixed part, as they are also manipulating the survival inventory, yet use that same method that leaves slot to '-1', or seem to use slot number (while it is always 0). (Who knows, maybe some of those are behind the duplication issues during merchant access.)

Background
The problem had two parts.

First one was that the server is sent a packet which does not reveal which slot is being pointed (so it can not adjust its own idea of quantity) while client-side happily adjusts its own local stack and throws out a new item (which is apparently registered both on client and server sides). Once another operation is done, the server will send back data based on its own, unmodified quantity, and client updates its quantity to the server's one. Duplication achieved. With various funny side-effects (as illustrated by the many duplicates etc.)

The second part was part of the fixing process. The relevant method was receiving incorrect slot numbers, as they were not initialized properly. Getting the correct slot number is needed so that it can be sent to the server.

Comment by Andrew Mancini [ 19/Jan/13 ]

Works with all blocks with a GUI except Minecart with Chest. I first found this while enchanting and using enchanted books, as I was about to report. I've always needed 5 items in the hotbar and needed to shift click them before opening a chest/beacon block/anvil etc...

Minecraft 1.4.7

**Edit: This doesn't only occur when opening a GUI block. While testing this bug, I found that instead of opening the chest (for example) reopen your inventory and close it. It works sometimes.

Therefor, this might even work when opening villager GUI. I believe there are already some bugs on the bug tracker reported with villagers.

Comment by Kumasasa [ 08/Jan/13 ]

Can still reproduce with 13w01b.
Stick to my steps above. (edit: swapped the first two steps)

Comment by FireHunterX [ 08/Jan/13 ]

Can't get it to work in 13w01b.
May be fixed.

Comment by Dean Baset [ 30/Dec/12 ]

Ah, now I got it to work. thanks, richard!

Comment by Alex Jennings [ 30/Dec/12 ]

Thank you Richard.

Comment by Richard Harvey [ 30/Dec/12 ]

Also confirmed, made a youtube video of it..

http://www.youtube.com/watch?v=JcDRiPGADiA

Comment by Alex Jennings [ 30/Dec/12 ]

I've reproduced it on 3 separate computers and [Mod] Kumasasa reproduced it.
The only thing you could've done to not be able to reproduce it is move a block in any direction, after exiting the inventory, before opening the chest.
Or you just didn't follow my directions right.

Comment by Dean Baset [ 28/Dec/12 ]

Unable to reproduce

Comment by Alex Jennings [ 27/Dec/12 ]

Yea it's strange. I've also tried it in survival but i couldn't replicate it there. It only happens when pulling from the creative inventory.

Comment by Kumasasa [ 27/Dec/12 ]

OMG. Sorry not seeing that bug.
Of course is the grass block duplicated in my inventory, one in the hot bar, one above.
I'd always looked in the chest.

Comment by Alex Jennings [ 27/Dec/12 ]

As for the mods I had rei's minimap installed then I did a forced update and it still happened.

Comment by Alex Jennings [ 27/Dec/12 ]

The duplicated block shows up in the hot bar, not the chest. I apologize for not making that more clear. If you didn't move the grass block after the first screenshot then you shouldn't have had the grass block in your hot bar and inventory in the second screen shot.

Comment by Kumasasa [ 27/Dec/12 ]

Please do not mark issues as private, unless your bug report is a security issue containing information that may compromise your server/client.

Comment by Kumasasa [ 27/Dec/12 ]

What mods do you have installed ?

Comment by Kumasasa [ 27/Dec/12 ]

Cannot reproduce.
Confirmed.

  • placed new chest
  • Cleared inventory with /clear
  • moved grass block to hotbar
  • moved grass block from hotbar to survival inventory without closing the interface
  • closed interface
  • opened chest
    -> -no grass block in the chest Grass block in the hot bar and in the slot above.
    See screenshots
Generated at Sun Jan 12 12:07:49 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.