16

Player A created a Single Player game in Minecraft, hosted on his laptop, and opened to LAN at my house with about 4 people in total, including myself, Player B. Player A's laptop was soon struggling with the hosting responsibilities, and we wanted to transfer the saved game to Player B's desktop.

We transferred the file onto my computer, and loaded it. The world seemed to be the same, but when I logged in as Player B, it loaded the player data for Player A; I was in his spot, with his items, and had his experience.

Upon digging, I believe that the reason for this is because the way that the game's playerdata saved his player had something to do with him being the host. Now, since I'm the host, it must be assigning me the player with the previous host attributes.

I have not yet logged him (Player A) in while I (Player B) am hosting on the desktop, but I assume he would have my credentials?

Also, another player, who was on the server last night while Player A was hosting, logged in while I started hosting, and her character was the same; she had the same items, was in the same location as last night, etc.

Why am I logged in as the previous host, Player A, but it seems everyone else has their correct credentials? Is there a way I can change this so that I'm logged in as Player B while hosting?

1 Answer 1

17

Each player has their own file in a world's playerdata folder, named by their UUIDs:

enter image description here

These files contain their inventory, location, health, etc.

Note: If it's an older world there may also be a players folder with similar files. Ignore this, it is obsolete and does nothing.

In addition to this storage location, on singleplayer, the player's data is stored in level.dat, always under the name "Player". This file contains other data, and you need to use the editor NBTExplorer in order to view contents and manage the data:

enter image description here

On singleplayer this default "Player" version takes precedence. If it exists, it will always be used first, and it doesn't care who the user is, so long as it's singleplayer. Both of these locations are saved to with your current in-game data.

This means that you can play a world on singleplayer with one account, then give it to a friend (or upload it to a site) for other people to continue where you left off (still on singleplayer), it will use the Player file rather than the one specific to your UUID.

As LAN worlds are created by first launching singleplayer then opening the world to LAN, this Player data in level.dat will be the data of the host, Player A. As you are now opening the world on singleplayer (before opening it to LAN), it is using the data of the Player file, or Player A's data, rather than your own UUID file.

This also means that the data for your character stored in the UUID file has probably been overwritten with Player A's data. Everyone else still has their own UUID file intact, as they've only logged into the world while it is on multiplayer.

To fix this, you'd first need a backup from before the transfer. In level.dat, delete the "Player" section and then log into the world on singleplayer. This should force it to load your UUID file and then re-create the Player section in level.dat based on that, rather than the other way around. Everything should work fine from there.

4
  • 1
    Though this answer taught me a lot about how the playerdata is stored, I tried the fix as you said, and it was still giving the same functionality, but instead, when both Player A and Player B (he and I) logged into my hosted version, we both had his items. This could have been due to a misstep in your instructions before copying the file over, but we tried it again and still yielded the same results. Thanks anyways though, very thorough answer! Commented Dec 24, 2014 at 9:01
  • 1
    @AlGoreRhythm Both of you having his items is what I would expect to normally happen originally, without deleting the Player data. Are you sure you are deleting the correct data, and doing so BEFORE you log into it on singleplayer (thus overriding your original data)? I just tried it out with a friend and my method worked fine.
    – SirBenet
    Commented Dec 24, 2014 at 11:26
  • 3
    With NBTExplorer* Commented Sep 10, 2017 at 13:10
  • @NeatoBandito Just tried out your method, it works very well! Learned a lot! Commented Nov 25, 2021 at 19:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .