/data
Reads and edits the raw NBT of a block entity, entity, or command storage. /data get queries a value (optionally scaled), /data merge shallow-merges a compound, /data modify performs targeted set/insert/append/prepend operations (including copying from another source), and /data remove deletes a path. This is the modern replacement for editing NBT through /entitydata and /blockdata.
What is /data used for?
What /data does
Reads and edits the raw NBT of blocks, entities, and command storage — getting a value, merging a compound, modifying a path, or removing data.
When to use /data
Reach for it when you need to inspect or change data the GUI can't touch: an entity's health or attributes, a container's contents, a sign's text, or values shared between datapack functions.
Common uses & tips
Map-makers use /data modify … set from to copy values between entities, and pair /data get with /execute store to read NBT into a scoreboard. It replaced the old /entitydata and /blockdata.
Syntax
Parameters
- action
- literal
- get / merge / modify / remove.
- source kind
- literal
- block <x y z>, entity <selector>, or storage <id>.
- pathoptional
- NBT path
- Dotted path into the compound, e.g. Health or Inventory[0].id.
- nbtoptional
- SNBT
- Stringified NBT used by merge / modify ... value.
Command builder
Fill in the options below to generate a ready-to-paste /data command.
get / merge / modify / remove.
block <x y z>, entity <selector>, or storage <id>.
Dotted path into the compound, e.g. Health or Inventory[0].id.
Stringified NBT used by merge / modify ... value.
Examples
Print the executing player's full NBT to chat.
Read just your current health value.
Freeze the nearest villager by setting NoAI.
Copy your held item into the container below you.
Common questions
How do I see an entity's NBT in Minecraft?
Use /data get entity <target> with no path to dump everything, or add a path like /data get entity @e[type=zombie,limit=1] Health to read one value. Cheats must be enabled.
What replaced /entitydata and /blockdata?
/data merge and /data modify. /data merge entity <target> {…} replaces the old /entitydata, and /data merge block <x y z> {…} replaces /blockdata.
Permission level
/data requires Cheats (op level 2). In single-player you need the world's "Allow Cheats" toggle on. On a multiplayer server you need to be opped — see /op.