[MC-63] Player data and region files not written/saved to disk simultaneously, causing item loss/duplication Created: 24/Oct/12  Updated: 09/Dec/24

Status: Reopened
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.1, Snapshot 13w19a, Snapshot 13w21a, Minecraft 1.8.8, Minecraft 16w02a, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.2, Minecraft 17w17a, Minecraft 17w17b, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 18w15a, Minecraft 1.13-pre1, Minecraft 1.13-pre2, Minecraft 1.13.2, 1.14.4, 1.15.2, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 20w45a, 1.16.5, 21w06a, 21w07a, 21w08b, 21w11a, 21w14a, 21w19a, 1.17, 1.17.1 Pre-release 1, 1.17.1, 1.18.1, 22w03a, 1.19, 1.19.2, 1.19.3, 23w03a, 23w04a, 1.19.4 Pre-release 4, 1.19.4 Release Candidate 2, 1.19.4, 23w18a, 1.20 Pre-release 5, 1.20, 1.20.1, 23w32a, 1.20.2, 1.20.5, 1.20.6, 1.21 Pre-Release 4, 1.21, 1.21.1, 24w40a, 1.21.4
Fix Version/s: Minecraft 1.4.5

Type: Bug
Reporter: Mask3D_WOLF Assignee: Unassigned
Resolution: Unresolved Votes: 111
Labels: duplication, multiplayer, singleplayer

Issue Links:
Duplicate
is duplicated by MC-16358 Item duplication bug Resolved
is duplicated by MC-19596 duplicate bonus chest Resolved
is duplicated by MC-24546 Dupe using a chest in Singleplayer Resolved
is duplicated by MC-151328 Item duplication 1.14 Resolved
is duplicated by MC-154379 1.14.2 Item Dupe. Resolved
is duplicated by MC-156609 duplicating items death glitch Resolved
is duplicated by MC-158297 Dupe in 1.14.4 Involving opening one ... Resolved
is duplicated by MC-158465 Inventory duplication on player death Resolved
is duplicated by MC-163997 Losing Chestplate during Power Outage Resolved
is duplicated by MC-173045 Duping on Servers Resolved
is duplicated by MC-191057 DUPE bug on single player TOO OP!! MU... Resolved
is duplicated by MC-191841 Minecraft brand new dupe bug Resolved
is duplicated by MC-192430 Return Portal did not form in the Net... Resolved
is duplicated by MC-199863 Duplication Glitch using Crafting Tables Resolved
is duplicated by MC-200526 Deleted Items in hand after crash Resolved
is duplicated by MC-201728 dupe items issue Resolved
is duplicated by MC-202060 If you open a crafting table and put ... Resolved
is duplicated by MC-202117 Duplication bug Resolved
is duplicated by MC-205022 End City 20w45a bug Resolved
is duplicated by MC-211909 Duplication Glitch Resolved
is duplicated by MC-215198 transported to last location after dy... Resolved
is duplicated by MC-229166 Duping-Bug (Items, XP) Resolved
is duplicated by MC-229571 World Optimization is producing stran... Resolved
is duplicated by MC-232140 Duplication glitch involving restarti... Resolved
is duplicated by MC-234631 minecraft duplication glitch Resolved
is duplicated by MC-238666 Duplication glitch/Cancel death on Ha... Resolved
is duplicated by MC-238690 Infinate respawn glitch for hardcore ... Resolved
is duplicated by MC-239150 OP Duplication Glitch Resolved
is duplicated by MC-242889 Item duplication bug Resolved
is duplicated by MC-247439 Player and world data aren't autosave... Resolved
is duplicated by MC-248312 Items get duplicated after game crash Resolved
is duplicated by MC-253386 duplication Resolved
is duplicated by MC-253927 item dupe bug Resolved
is duplicated by MC-255043 If game crashes after putting items i... Resolved
is duplicated by MC-256355 A duplication glitch. Resolved
is duplicated by MC-258946 A bug with the possibility of a dupe,... Resolved
is duplicated by MC-259031 New found Duplication Glitch 1.19,3 Resolved
is duplicated by MC-260843 Items will dupe on Task Manager exit. Resolved
is duplicated by MC-260928 The game doesn't autosave world data ... Resolved
is duplicated by MC-262457 Closing the game in an unsaved world ... Resolved
is duplicated by MC-262558 Duplication bug? Resolved
is duplicated by MC-262937 Death Dupe Glitch Resolved
is duplicated by MC-263566 Infinite netherite Resolved
is duplicated by MC-263647 Duplication of items after death. Resolved
is duplicated by MC-263749 A dupe item glitch Resolved
is duplicated by MC-265991 Items disappear if game crashes/freez... Resolved
is duplicated by MC-273123 Ability to dupe certain items and eve... Resolved
is duplicated by MC-273643 Duplication of inventory using chests... Resolved
is duplicated by MC-273980 The Dark Chunk Bug Resolved
is duplicated by MC-274838 Dupplication Glitch! Items in the che... Resolved
is duplicated by MCL-16879 World saves changes but player dosen't. Resolved
Relates
relates to MC-75330 Item duplication glitch Resolved
relates to MC-409 Worlds not saving upon exit (single p... Resolved
relates to MC-3728 Item Duplication Bug Resolved
relates to MC-4247 putting items in chests in singleplay... Resolved
CHK:
Confirmation Status: Confirmed
Category:
Player
Mojang Priority: Normal
Area: Platform

 Description   

The bug

Due to player data and region files not written to disk simultaneously, items can be duplicated quite easy under certain conditions. As of 1.16, Minecraft can be configured to run in synchronous disk i/o mode, making this issue more obvious and easier to reproduce.

How to reproduce

  1. Make sure syncChunkWrites in options.txt is set to true
  2. Create a world and fill your inventory with things
  3. Leave the world to make sure player data gets written to disk
  4. Rejoin the world
  5. Die
  6. Forcefully terminate minecraft's java process (Taskmanager, /taskkill, ...)
  7. Rejoin the world
    Notice things you've collected now appear on the ground and in your inventory

Video demonstrating the issue (potentially outdated regarding reproduction): https://youtu.be/0RYRj5XN8vk?t=25s



 Comments   
Comment by Minecraft386882 [ 08/Dec/24 ]

Can confirm in 1.21.4 

Comment by Chilenderino [ 16/Sep/24 ]

Couldn't manage to confirm 24w37a

Comment by Jean Dubois [ 25/May/24 ]

Can confirm in 1.20.5

Comment by Brain81505 [ 09/Aug/23 ]

Can confirm in 23w32a

Comment by NguyenFranky [ 08/Jun/23 ]

Can confirm in 1.20

Comment by Brain81505 [ 06/May/23 ]

Can confirm in 23w18a

Comment by Brevort [ 11/Mar/23 ]

This not only can duplicate items but can also destroy items. I lost a chest full of stuff because of this bug because my computer crashed

Comment by Brain81505 [ 01/Feb/23 ]

Can confirm in 23w06a

Comment by Brain81505 [ 25/Jan/23 ]

Can confirm in 23w04a

Comment by Brain81505 [ 18/Jan/23 ]

Can confirm in 23w03a

Comment by charlie_weirdo [ 08/Jan/23 ]

This happened to me in 1.19.3 when my computer froze. I got 32 free chests!

Comment by Mask3D_WOLF [ 29/Dec/22 ]

Can anyone reproduce in 1.19.3?

Comment by Antwnhs M. [ 09/Nov/22 ]

Cannot reproduce this in vanilla 1.19.2

Comment by Mask3D_WOLF [ 25/Oct/22 ]

Can anyone reproduce in 1.19.2?

Comment by pulpetti [ 30/Jan/22 ]

In 22w03a.

Comment by FX - PR0CESS [ 15/Dec/21 ]

Now that chunks save whenever in 1.18, its going to be harder to see this effect without a lower render distance. Just giving a heads up

Comment by Ceresjanin123 [ 08/Feb/21 ]

This happened to me by accident
Basically I died on my friends server and a few minutes later the server crashed.
When the server restarted my items were still on the ground and in my inventory

Comment by Jibril Wathon [ 27/Dec/20 ]

Can raproduce in 1.12.2, 1.13.1, and 1.14.4 with different method. But still cant reproduce on 1.15.2 and 1.16.1

Comment by Galaxy_2Alex [ 31/Oct/20 ]

Modified title of report to be found more easily.

Comment by [Mod] Michael Wobst [ 25/Jun/20 ]

Use the task manager to forcefully kill the java thread. I've just noticed that ALT+F4 places a WM_CLOSE causing Minecraft to quit gracefully.
Also do it right after you have died to reduce the chance that player data gets written to disk in the meantime.

Comment by Peca [ 25/Jun/20 ]

I just tried to replicate this in 1.16.1 using the new instructions in the bug report. Could not get it to work. I used ALT+F4 and kill process in task manager. Maybe it needs just the right timing.

Comment by Conem [ 09/Jun/20 ]

Could anyone who has been able to reproduce this issue in 1.15+ provide detailed repro steps, please? None of the mentioned above work in 1.16-pre2.

Comment by W_V [ 31/Jan/20 ]

Cannot reproduce in 1.15.2 (this)

Comment by [Mojang] slicedlime [ 20/Sep/19 ]

New repro steps provided in MC-161408.

Comment by [Mod] violine1101 [ 19/Sep/19 ]

Then please provide some consistent reproduction steps for that that don't cause the world file to be corrupted.

Comment by Fabian Röling [ 18/Sep/19 ]

You can initiate a save by pressing Alt+F4 and then stop the process with the right timing.

Comment by [Mod] violine1101 [ 18/Sep/19 ]

Yes, killing the process closes the game without saving, but the inventory isn't saved either, meaning only the items laying on the ground remain. Seems like this might have been fixed indeed.

F3+C saves the game completely before causing a crash.

Comment by Fabian Röling [ 18/Sep/19 ]

Of course there is. Killing the process. Either using the task manager or by holding F3+C.

Comment by [Mod] violine1101 [ 18/Sep/19 ]

I'm unable to reproduce in 1.14.4. The game now seems to save the current state of the world when Alt+F4 is used. This bug might still exist if there is a way to close the game without saving.

Comment by [Mojang] Adrian Östergård [ 18/Sep/19 ]

Is this still an issue in 1.14.4 or later?

Comment by Galaxy_2Alex [ 23/Apr/19 ]

I am unable to reproduce with the steps given in 1.14-pre5. Can someone else?

If not, I will close this ticket after seven days.

Comment by xyz [ 18/Jun/18 ]

Confirmed for Minecraft 1.13-pre2.

Comment by Pau Olivares [ 14/Jun/18 ]

This glitch/bug is confirmed for Minecraft 1.13-pre1.

Comment by James Mills [ 12/Apr/18 ]

Confirmed for latest snapshot (18w15a)...

Comment by M. C. [ 30/Apr/17 ]

Confirmed for latest snapshots 17w17a and 17w17b.

Comment by iFuzion77 [ 22/Dec/16 ]

can confirm in 1.11.2

Comment by Nathan Stoltenberg [ 23/Nov/16 ]

Apologies for the multitude of emails, wasn't considering how editing affects the email servers.
As far as this bug goes, is there any chance of getting the status changed to reopened?
In addition to simply dropping items on the ground, players are also able to drop the item into a hopper and disconnect. The hopper updates and pulls in the item, but the player's inventory is not updated and still has the item in it, duplicating the item. This works with any item, but is especially game-breaking with shulker boxes filled with items.

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

Please use the preview function (the blue symbol out the bottom left). You just sent 130 mails through JIRA.

Comment by Nathan Stoltenberg [ 20/Nov/16 ]

This is reproduceable on Minecraft 1.11, tested with the vanilla server jar.

https://youtu.be/RvsiKgHG1rE?t=13s

Players are able to dupe items or stacks of items by sending a disconnect packet from their client and dropping an item at the same moment. The player drops the item in their hand, and closing the connection with their client upon dropping an item. When they re-connect in, the item is in their hand and on the ground.

[03:55:09] [Server thread/INFO]: pudens29 lost connection: TranslatableComponent{key='disconnect.genericReason', args=[Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(1) + length(1) exceeds writerIndex(1): UnpooledHeapByteBuf(ridx: 1, widx: 1, cap: 1)], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null,insertion=null}}
Comment by [Mod] md_5 [ 20/Nov/16 ]

Anyone seeing similar stuff in 1.11?

Comment by Galaxy_2Alex [ 26/Sep/16 ]

Seems like a reasonable explanation to me. If anyone still has this issue, please leave a comment, if there is none within a reasonable time frame, this will be marked as "Fixed".

Comment by Marcono1234 [ 18/Sep/16 ]

That wasn't really a code analysis but rather an explanation why it should not happen anymore

Comment by Marcono1234 [ 10/Aug/16 ]

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

It looks like the player data is only saved when either all chunks are saved or when the player logged out. To create this bug in singleplayer the client needs to crash and before the server can shut down because the owner left the server needs to crash as well. This is very likely impossible because shutting down the server happens directly after the player data was saved.
In multiplayer this can happen more likely, if the player leaves the server and the server crashes at some point after that before the chunks are saved, but this is the intended behaviour.

But please recheck.

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

Has anyone tips to reproduce this? Do I have to press Alt+F4 right when the item appears first in the hotbar, while the little animation still runs? And at what point of the animation is the probability the highest?

Comment by [Mod] Ezekiel (ezfe) [ 24/May/16 ]

Alt+f4 and command+q are very different commands.

Comment by null (Inactive) [ 23/May/16 ]

I can't seem to reproduce this in 16w20a. I'm on OS X, and I used Cmd-Q to close the game (instead of Alt-F4). In the log it says that it saved the worlds as well as the players when I quit the game, and the item was not on the ground when I reopened the game.

Is this a Windows-only issue?

Comment by Peca [ 09/Mar/16 ]

Confirmed in 1.9.1-pre1.

Comment by Commander Sealand [ 01/Mar/16 ]

Unable to reproduce in 1.9.0

Comment by Mustek [ 18/Jan/16 ]

Reopened from MC-95793

Comment by Kumasasa [ 24/Dec/15 ]

Is this still an issue in the current Minecraft Snapshot 15w51b 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.

Comment by James (inactive) [ 22/Dec/15 ]

Cannot reproduce on 15w51b.

Comment by bob [ 15/Apr/15 ]

This bug is still in the game in a similar form. Now you cannot dupe the item by alt f4, instead you must save and quit to menu but the timing is more precise.

Comment by [Mod] Ezekiel (ezfe) [ 11/Jul/13 ]

I cannot reproduce this bug in 1.6.2.

Comment by Tails [ 14/Jan/13 ]

Unable to reproduce. Instead of appearing on the ground and in my inventory, items disappear from both instances, which indicates this is somewhat fixed, though atleast one instance should remain after reloading the world, but I assume this is related to MC-409. Resolving for now.

Comment by Callum Tennant [ 06/Jan/13 ]

@Isaak Rogers No, you can open to LAN then enable cheats within that menu.

Comment by Chalmes (Jon) [ 19/Nov/12 ]

Can't reproduce 1.4.5pre

Comment by TnT (Trinitro Toluene) [ 10/Nov/12 ]

Is this still a concern on Minecraft 1.4.4 Pre-Release? If so, please update the version affected.

Comment by Isaak Rogers [ 08/Nov/12 ]

@Zachary Connor
Unless, of course cheats are off.

Comment by Zachary Connor [ 30/Oct/12 ]

While this is a bug, it's not important, because it doesn't affect gameplay, as you could just as easily put yourself in creative mode and give yourself the blocks.

Comment by theinzide [ 28/Oct/12 ]

is true, I'm in 1.4.2 and it worked

Comment by Tristan Allen [ 27/Oct/12 ]

I tested it in 1.4.1Pre, and it worked there. As for what Nathan W. said, It's a bug that is still there, so it should be considered an ongoing bug in this version.

Comment by Vit Musienko [ 25/Oct/12 ]

This glitch only works in 1.2.5 release, it was fixed

Comment by Nathan Workman [ 24/Oct/12 ]

As this has been in the game for a while I do not believe that this should not be considered a 1.4.1Pre bug. It is more a long standing bug than a bug which was a result of switching to 1.4.1Pre.

Comment by Alexander Hammett [ 24/Oct/12 ]

I just tried it:
Threw a dozen diamond blocks on the ground, pressed esc then again, then force-closed the game.
When i reopened minecraft the items on the ground were invisible, but i was still able to pick them up. Interesting :/
(Running Mas OS X Mountain Lion btw)

Comment by Tristan Allen [ 24/Oct/12 ]

Just tried this, and managed to dupe a stack of diamonds and a stack of melons.

Generated at Sun Jan 12 11:49:41 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.