Lost your inventory after changing online-mode? Get it back

When a server switches between online and offline mode, players log in with an empty inventory. Their old file is still there under their previous UUID. Here is how to put it back.

Short answer: nothing was deleted. When online-mode changed, each player got a new UUID, and the server created a new, empty file for that UUID. The old inventory is still in playerdata/ under the previous UUID. Stop the server, copy the old file over the new one, and the player gets everything back.

How to tell it happened

  • Players spawn at the world spawn with nothing, but the world and their builds are intact.
  • playerdata/ (or players/data/ since 26.1) contains two files for the same person: an old, large one and a new, small one with today's date.
  • The two UUIDs differ in their 13th character: 4 for online, 3 for offline.

Fix every affected player at once

  1. Stop the server, then open its folder in the editor with Open folder (Chrome or Edge).
  2. Open Players, then Online / offline UUIDs. The editor detects the mode the server uses now from the latest logins.
  3. The players have two files section lists everyone with an old and a new file, with each file's play time and last save. The one with more play time is picked by default.
  4. Click Migrate. The old inventory, advancements and statistics move to the current UUID. The short-lived new file goes to .dat-editor-history as long as Keep previous versions is ticked under the editor.

If the player played a lot in the new mode too, keep the new file instead, and use Move to another account to bring over only the old inventory and ender chest.

By hand, for one player

  1. Find both UUIDs: the current one in usercache.json (the newest entry with the player's name), the old one from the file list or your logs.
  2. With the server stopped, rename the new <new-uuid>.dat to keep it aside, then copy <old-uuid>.dat to <new-uuid>.dat.
  3. Do the same in advancements/ and stats/ with the .json files.
  4. Open the copied file in the editor and set I[ ]UUID to the new UUID. The game usually copes without it, but plugins that read the file may not.

Stop it from happening again

Pick one mode and keep it. If you have to switch, migrate everyone before the first player joins in the new mode: the switching guide walks through it. Keep in mind that offline mode lets anyone join under any name, including yours, unless an authentication plugin protects the accounts.

Ready to edit?Open the file in the editor: every value keeps its NBT type and the file is saved in its original format.