-
Bug
-
Resolution: Unresolved
-
None
-
Minecraft 1.4.2, Minecraft 1.4.6, Minecraft 1.7.4, Minecraft 14w05b, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 1.7.10, Minecraft 14w32d, Minecraft 1.8.1-pre3, Minecraft 1.9.4, Minecraft 1.10, Minecraft 1.10.1, Minecraft 1.10.2, Minecraft 1.11.2, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 1.13-pre6, Minecraft 18w30b, Minecraft 1.13.2, Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3, Minecraft 1.14 Pre-Release 4, Minecraft 1.14 Pre-Release 5, 1.14.4, 1.15.2, 20w13b, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 1.16.2, 1.16.4, 1.16.5, 21w06a, 21w07a, 21w08b, 21w11a, 21w14a, 1.17 Release Candidate 2, 1.17, 1.19.3, 23w03a, 23w04a, 23w05a, 23w06a, 1.20.4
-
Confirmed
-
Player
-
Normal
-
Platform
The bug
For singleplayer worlds the player data is written to the level.dat file as well (called "default player data" in the following) and always used when someone opens the world. This creates the following two unwanted situations.
Cannot start with empty inventory in a world of someone else
Because the default player data is always used you cannot play in the world of someone else with new player data but instead start where the player who last played left and have the same items.
Default player data is used even if player data exists after playing in LAN
When you played in LAN before and an entry in the playerdata folder exists for a player the default player data is used anyways.
Imagine the following: Player 1 hosted the world and player 2 joined. After that player 2 opens the world, even though a player data entry exists he gets player 1's player data (=default player data) which even overwrites player 2's player data entry when he leaves the world.
Outdated default player data is used after loading world on a dedicated server
When a singleplayer world is loaded by a dedicated server and the default player data player joins, their playerdata entry is updated, but their default player data is not. Therefore when they load the world in singleplayer again, they have the old outdated player data.
Possible solution
See this reddit post for a discussion.
Have the game perform these steps when loading a world:
- If the default player data exists and for the same UUID a playerdata entry exists, overwrite the default player data with that. This is needed for the case where a singleplayer world was loaded by a dedicated server and therefore the default player data became outdated.
Then continue with the following steps: - If the default player data exists, but the UUID does not match the UUID of the current player:
Possibly offer a checkbox to determine whether the default player data should be overwritten by the current player.
Provide these options:- Offer to continue where that player last left
- Offer to use own player data (in case playerdata entry exists) or otherwise with empty inventory at world spawn
- Otherwise: If the default player data exists and the UUID matches the UUID of the current player, use that data
- Otherwise: If no default player data exists use the matching playerdata entry or, in case that does not exist, start with an empty inventory at world spawn
Workaround
Keep in mind that this is a bug tracker and not a discussion forum or a help desk. For questions, ask for example on reddit, the Minecraft Forum, or on other platforms.
Create a backup of your world before trying the following workaround. Otherwise you might loose data or your world can become corrupted.
The following steps require an NBT editor. Make sure it is up to date and supports changes to NBT structure introduced in the latest versions. You can use for example NBTExplorer version 2.8.0(+).
- Open the level.dat file of the world with an NBT editor
- Delete the Data > Player entry
- Save the file
- is blocked by
-
MC-124027 Default singleplayer player data is not written or read to level.dat anymore
- Resolved
- is duplicated by
-
MC-13576 Different accounts accessed via the same PC share inventories
- Resolved
-
MC-17785 Server login inventory copy
- Resolved
-
MC-44064 "Open To Lan" game will overwrite player data
- Resolved
-
MC-52929 Player 2 given Player 1's inventory, location, XP
- Resolved
-
MC-67379 Item Cloning Glitch in LAN Survival
- Resolved
-
MC-80246 Duplicating items in Singleplayer using Open to LAN feature
- Resolved
-
MC-112043 Incorrect Character Data on LAN Server
- Resolved
-
MC-122674 Inventory Switch
- Resolved
-
MC-124097 2nd Player Advancements overwritten by 1st Player advancements
- Resolved
-
MC-130818 Updating a world from 18w16a to 1.13pre1 gives me a different inventory / spawn point
- Resolved
-
MC-133046 Player 2 logs into a single player world and receives the inventory from player 1.
- Resolved
-
MC-145307 Old player's inventory is loaded on LAN game
- Resolved
-
MC-157967 Local Area Network Server Progress Deleted
- Resolved
-
MC-167227 When ever a account is switch it keeps the same inventory in that world, it essentially duplicates everything a player has.
- Resolved
-
MC-175421 Singleplayer with multiple accounts dupe
- Resolved
-
MC-175955 LAN Inventories Inconsistant
- Resolved
-
MC-176509 In single-player worlds, statistics and advancements are unique to each Mojang account, while inventory is shared.
- Resolved
-
MC-193732 Inventorys duplicated by switching accounts (singleplayer)
- Resolved
-
MC-199552 Player data merged with launcher user switch
- Resolved
-
MC-210908 Duplication Glitch with LAN worlds.
- Resolved
-
MC-222811 Found dupe bug
- Resolved
-
MC-231106 Lost inventory when using new pc
- Resolved
-
REALMS-2173 Spawning with wrong inventory
- Resolved
-
MC-4600 Lan world progress save failure
- Resolved
- relates to
-
MC-5405 Duplication of Items/xp in game
- Resolved
-
MC-2368 Accidental joining of game causes world to not save for the session
- Resolved
-
MC-5222 Join server with correct skin and username, but wrong inventory, experience level, and position
- Resolved