---
title: "Editing Minecraft Player Data: UUIDs, NBT Files and Safe Inventory Fixes"
description: "Fix one player's broken inventory: where player data lives before and after 26.1, matching a name to a UUID, and editing a .dat file without corrupting it."
url: "https://www.gameserverkings.com/knowledge-base/minecraft/editing-player-data-nbt/"
category: "Minecraft"
category_url: "https://www.gameserverkings.com/knowledge-base/minecraft/"
published: "2026-08-19T10:07:59.766Z"
updated: "2026-08-19T10:20:09.179Z"
source_format: "markdown"
site: "GameServerKings"
---

# Editing Minecraft Player Data: UUIDs, NBT Files and Safe Inventory Fixes

One player has a stack of 64 netherite blocks that a dupe bug handed them, or a corrupted inventory that crashes their client every time they log in, or thirty levels that vanished in a server rollback. You do not want to reset the world; you want to change one file. This guide covers where that file is, how to work out which one belongs to which player, and how to edit it without breaking the save.

Rolling back a *griefed build* is a different job, covered in [Minecraft Grief Protection and Rollback](/knowledge-base/minecraft/grief-protection-and-rollback/). This page is about the player, not the world.

## Try It Without Touching a File First

Most inventory fixes do not need file editing at all, and the in-game route is faster and far safer. Run these from the panel **Console** or in-game as an operator, with the player online:

| Command | What it does |
|---|---|
| `/clear <player>` | Empty their inventory entirely, or `/clear <player> <item>` for one item type |
| `/clear <player> <item> <count>` | Remove a specific number of a specific item |
| `/item replace entity <player> <slot> with <item> [<count>]` | Put an exact item into an exact slot |
| `/item replace entity <player> <slot> from entity <other> <slot>` | Copy an item from one slot or player to another |
| `/xp set <player> <n> levels` | Reset or set experience |
| `/gamemode`, `/effect clear`, `/attribute` | The rest of the per-player state |

Slot names are the readable ones: `hotbar.0` to `hotbar.8`, `inventory.0` upwards, `weapon.mainhand`, `weapon.offhand`, `armor.head`, `armor.chest`, `armor.legs`, `armor.feet`, `enderchest.0` upwards. The full command reference is in [Minecraft Server Commands](/knowledge-base/minecraft/admin-commands/).

> [!IMPORTANT] `/data` can read a player and cannot write one
> `/data get entity <player> <path>` works and is the best way to inspect what is actually in someone's NBT. But `/data merge`, `/data modify` and `/data remove` **fail** on a player — the wiki lists "tries to edit a player's data" as an explicit failure condition, and player NBT cannot be removed at all. That restriction is the entire reason this article exists. If `/item` and `/clear` cannot express the change you need, the file is your only option.

Two more things worth knowing before you reach for a file. The player must be **online** for any entity-targeted command to resolve. And a permissions plugin such as [LuckPerms](/knowledge-base/minecraft/luckperms-permissions/) will happily give a trusted moderator `/clear` without handing over the whole console.

## Where Player Data Lives

This changed recently, and almost nothing written before 2026 has caught up.

| Data | 26.1 and later | 1.21.11 and earlier |
|---|---|---|
| Player inventory, position, XP | `world/players/data/<uuid>.dat` | `world/playerdata/<uuid>.dat` |
| Advancements | `world/players/advancements/<uuid>.json` | `world/advancements/<uuid>.json` |
| Statistics | `world/players/stats/<uuid>.json` | `world/stats/<uuid>.json` |

Minecraft 26.1 restructured the whole world save, and the player storage move was part of it: `playerdata` became `players/data`, `advancements` became `players/advancements`, and `stats` became `players/stats`. The rest of that restructure — dimensions, region files, namespaced data — is covered in [Minecraft World Management](/knowledge-base/minecraft/world-management/).

You will also see `<uuid>.dat_old` next to each file. That is the previous save, kept automatically as a rollback, and it is often the fastest fix on this entire page: if the current file is broken, the one beside it is one save cycle older and probably fine.

> [!WARNING] Look before you follow any instruction that names a folder
> Which layout you have depends on the Minecraft version your server runs right now. Open the **File Manager**, open your world folder, and check whether you see `players/` or `playerdata/` before doing anything else.

Three more files sit in the **server root**, not the world, and are not player data even though they are keyed the same way: `ops.json`, `whitelist.json` and `banned-players.json`. Those are covered in [Minecraft Whitelist and Ban Management](/knowledge-base/minecraft/whitelist-and-ban-management/) and [Minecraft Op Permission Levels](/knowledge-base/minecraft/op-permission-levels/).

## Working Out Which File Is Whose

Player files are named by UUID, not by username — that has been true since 1.7.6. Getting the right UUID is where most of the difficulty on this page actually lives, because a player can have two.

**Online-mode UUID.** Issued by Mojang when the account was created, permanent, unaffected by name changes. Look it up from the username:

```text title="Mojang API"
https://api.mojang.com/users/profiles/minecraft/<username>
```

That returns the account's current name and its UUID as 32 unhyphenated hex characters. Insert hyphens in the `8-4-4-4-12` pattern to get the filename.

**Offline-mode UUID.** If the server runs `online-mode=false`, the player is never authenticated and Mojang's UUID is never involved. The server derives one instead: a **version 3 UUID generated from the MD5 hash of the string `OfflinePlayer:<username>`**. It is deterministic — the same username always produces the same UUID — and it has nothing to do with the real account.

The two are genuinely different for the same person:

| Username | Online-mode UUID | Offline-mode UUID |
|---|---|---|
| `Notch` | `069a79f4-44e9-4726-a5be-fca90e38aaf5` | `b50ad385-829d-3141-a216-7e7d7539ba7f` |
| `jeb_` | `853c80ef-3c37-49fd-aa49-938b674adae6` | `a762f560-4fce-3236-812a-b80efff0b62b` |

> [!TIP] You can tell them apart at a glance
> The first character of the **third** group is the UUID version. Online-mode UUIDs from Mojang are version 4 (`…-4726-…`). Offline UUIDs are version 3 (`…-3141-…`). A folder full of files whose third group starts with `3` is an offline-mode server, whatever the panel says.

The quickest local check is `usercache.json` in the server root, which maps names to UUIDs for everyone the server has seen recently. It is a cache, so it can be stale and it can be missing someone who has not joined in a while — use it as a shortcut, not as the authority.

This is also why a server that switches between online and offline mode appears to reset everyone's inventory: the UUID changes, so the server looks for a file that does not exist and creates a new empty player. The old file is still there under the old UUID. Behind a Velocity proxy the same thing happens if forwarding is misconfigured — see [Minecraft Server Networks](/knowledge-base/minecraft/multi-server-networks-with-velocity/).

## Editing the File Safely

Player data files are **GZip-compressed NBT**. They are not text, and a text editor will destroy them.

The procedure, in order, with no steps skipped:

1. **Take a backup** from the **Backups** tab — see [How to create a backup](/knowledge-base/general/how-to-create-a-backup/). This snapshots the whole server, not just the file you are about to break.
2. **Stop the server** from the Console tab and wait for the process to exit. The server holds the world open and writes player data on its own save cycle; editing underneath a running server means your change is overwritten at best and the file is corrupted at worst.
3. **Download the file** over [SFTP](/knowledge-base/general/how-to-upload-files-via-sftp/) or from the File Manager. Keep an untouched copy locally as well.
4. **Edit it** with an NBT tool (below).
5. **Upload it back** to the same path, replacing the original.
6. **Start the server** and have the player log in while you watch the console.

> [!CAUTION] Never edit a player file while the server is running
> Even a stopped, disconnected player is held in memory in some circumstances, and the save cycle writes the server's version over yours without warning. "It did not save" is almost always this.

### The tools

**Amulet** (`amuletmc.com`) is the actively maintained option — release 0.10.62 shipped on 11 August 2026 — and is primarily a world editor that also reads NBT.

**NBTExplorer** and **NBT Studio** are the two tools every older guide names. Both still open a player file, because the NBT container format itself has not changed. Both are also effectively unmaintained: NBTExplorer's last release was 2017 and its last commit 2023; NBT Studio's last release was 2022. They will show you the tree correctly; they know nothing about what the tags mean on a modern version.

**MCA Selector** (`github.com/Querz/mcaselector`, version 2.8, June 2026, updated for 26.2) is for region files and chunks — not player data. It is the right tool for deleting a corrupted chunk, which is a different fix for a different problem; [Minecraft World Management](/knowledge-base/minecraft/world-management/) covers that.

**The vanilla data generator** is the no-third-party-software route, and it is worth knowing about. Minecraft's own server jar has converted between GZip NBT and SNBT — the readable, command-style text form — since 1.13. On your own machine, with a server jar for your version:

```bash title="On your own computer, not the server"
# NBT -> readable text
java -DbundlerMainClass=net.minecraft.data.Main -jar server.jar --dev --input in --output out
# text -> NBT
java -DbundlerMainClass=net.minecraft.data.Main -jar server.jar --server --input in --output out
```

Rename the `.dat` to `.nbt` for the trip out, edit the resulting `.snbt` as plain text, and convert back. The one gotcha is a long-standing Mojang bug: running either converter twice into the same output folder deletes its own results, so use a clean output folder each time.

### What is inside

The tags you will actually be looking for: `Inventory` and `EnderItems` (lists of items, each with a `Slot`), `Pos` and `Dimension`, `XpLevel`, `XpTotal`, `Health`, `foodLevel`, `playerGameType` and `previousPlayerGameType`, `abilities`, `recipeBook`, `LastDeathLocation`, and `SpawnX`/`SpawnY`/`SpawnZ` for a bed or anchor respawn point.

Two version notes. Item contents have used the **data component format** since 1.20.5, so an item copied out of a 1.20.4 file will not mean the same thing in a 26.2 one. And inventory slot numbering changed in 25w03a: before then, armour and offhand were stored in the `Inventory` list as slots 100–103 and −106; from 1.21.5 they are not.

> [!NOTE] The blunt fix that usually works
> If someone's inventory crashes their client on join and you cannot find the offending item, **delete their `.dat` file** with the server stopped. They rejoin as a brand-new player at world spawn with an empty inventory and their level 0, and nothing else on the server is affected. Their builds, their claims, their ranks and their advancements all live elsewhere. Move the file aside rather than deleting it outright, so you can put it back if you were wrong about which one it was.

## Common Issues

- **The UUID has no file.** They have never joined, or the server changed between online and offline mode. Check the third group of the UUID for `3` versus `4`.
- **The edit reverted.** The server was running, or you uploaded to the old path on a server that has been through the 26.1 restructure.
- **The file will not open in the editor.** It is GZip-compressed NBT; make sure the tool is reading it as NBT and not as text, and check the download completed — a truncated file is a common cause.
- **You edited the right tag and nothing changed in game.** You edited `.dat_old` rather than `.dat`. They sit next to each other and the names differ by four characters.
- **Everyone lost their inventory at once.** That is not a player-data problem — it is a UUID-scheme change affecting every file, from `online-mode` flipping or from proxy forwarding being wrong. Nothing is deleted; the old files are still there.
- **The player's ops or whitelist entry also broke.** Same root cause: those files key on UUID too. See [Minecraft Whitelist and Ban Management](/knowledge-base/minecraft/whitelist-and-ban-management/).

## What to Read Next

- [Minecraft World Management](/knowledge-base/minecraft/world-management/) — the 26.1 world layout in full, plus region files and chunk deletion
- [Minecraft Whitelist and Ban Management](/knowledge-base/minecraft/whitelist-and-ban-management/) — the other UUID-keyed files, and the name-versus-UUID trap
- [Minecraft Server Commands](/knowledge-base/minecraft/admin-commands/) — `/data get`, `/item replace`, `/clear` and the operator command set
- [Minecraft Grief Protection and Rollback](/knowledge-base/minecraft/grief-protection-and-rollback/) — when the problem is the world rather than one player
- [How to upload files via SFTP](/knowledge-base/general/how-to-upload-files-via-sftp/) and [How to create a backup](/knowledge-base/general/how-to-create-a-backup/) — the mechanics used throughout
- [Converting a Singleplayer World to a Minecraft Server](/knowledge-base/minecraft/converting-a-singleplayer-world/) — why your own singleplayer inventory may not follow you
- [Minecraft Op Permission Levels](/knowledge-base/minecraft/op-permission-levels/) — who should be allowed to run any of this

**Primary sources used for this guide** (all checked 19 August 2026): the Minecraft Wiki on the [Java Edition level format](https://minecraft.wiki/w/Java_Edition_level_format), [Player.dat format](https://minecraft.wiki/w/Player.dat_format), [UUID](https://minecraft.wiki/w/UUID), [NBT format](https://minecraft.wiki/w/NBT_format), [/data](https://minecraft.wiki/w/Commands/data), [/item](https://minecraft.wiki/w/Commands/item) and the [data generators reference](https://minecraft.wiki/w/Minecraft_Wiki:Projects/wiki.vg_merge/Data_Generators); the [Mojang profile API](https://api.mojang.com/); and the release feeds for [MCA Selector](https://github.com/Querz/mcaselector/releases), [Amulet](https://github.com/Amulet-Team/Amulet-Map-Editor/releases), [NBTExplorer](https://github.com/jaquadro/NBTExplorer/releases) and [NBT Studio](https://github.com/tryashtar/nbt-studio/releases).

---

Made with 💜 by GameServerKings
