/data get entity @sThe /data command reads and writes NBT (Named Binary Tag) data attached to blocks, entities, and storage in Java Edition. This generator builds the full SNBT syntax for get, merge, modify, and remove operations without you needing to memorize the tag structure.
NBT data is the hidden layer underneath Minecraft. Every
chest stores its inventory as NBT. Every mob tracks its health, position, and AI state in NBT. Signs store text, command blocks store their commands, and
spawners define what entity they spawn, all through NBT. The /data command gives you direct access to read and edit these values.
This is a Java Edition exclusive. Bedrock Edition does not have the /data command. It is one of the most powerful commands in the game, used heavily in data packs, adventure maps, and server administration.
| Operation | Syntax | Description |
|---|---|---|
| get | /data get <target> [path] [scale] | Reads NBT data. Without a path, returns all data. With a path, returns that specific value. |
| merge | /data merge <target> <nbt> | Merges SNBT compound into existing data. Adds new tags, overwrites matching ones. |
| modify | /data modify <target> <path> <action> ... | Precise edits: set, append, prepend, or insert at a specific path. |
| remove | /data remove <target> <path> | Deletes a specific NBT tag from the target. |
Player restriction: you can read player NBT with /data get entity @s, but you cannot write to player NBT with merge or modify. Use specific commands like /effect, /xp, or /attribute to change player data.
1. Reading chest contents: /data get block <x> <y> <z> Items shows every item in a chest at those coordinates, including stack sizes and NBT.
2. Making mobs invulnerable: /data merge entity @e[type=villager,limit=1] {Invulnerable:1b} makes the nearest
villager invincible.
3. Custom sign text: merge custom text onto a
sign's block entity data to set colored or styled text that cannot be typed normally.
4. Data storage for scoreboard workarounds:
storage targets persist with the world and can hold arbitrary data structures. Data pack creators use them as variables that go beyond integer scoreboards.
5. Copying data between entities: /data modify with the from source lets you transfer NBT values from one entity or block to another.
It reads and modifies NBT data attached to blocks, entities, and storage. The four operations are get (read), merge (bulk write), modify (precise edit), and remove (delete a tag). This command is exclusive to Java Edition.
Block targets a block entity at specific coordinates (chests, signs, command blocks, spawners). Entity targets a mob or player via selector. Storage targets a custom named data store that persists with the world. Not all blocks have NBT, only block entities do.
You can read player NBT with /data get entity @s, but you cannot write to player NBT with merge or modify. This is a deliberate restriction. Use commands like /effect, /xp, or /attribute to change player data.
Merge combines an SNBT compound into existing data, adding new tags and overwriting matching ones in bulk. Modify gives finer control: set a specific path, append to a list, prepend, or insert at an index. Use merge for bulk updates and modify for precise edits.
Browse more Minecraft tools: