/data
View or change the hidden NBT data of entities and blocks.
Overview
What is the /data command?
The /data command reads, writes and merges the NBT data of entities, block entities (like chests and signs) and storage. NBT is the structured data behind everything in the game, so /data lets you inspect and edit health, inventory contents, custom names, positions and far more.
It's a core advanced tool: datapacks use /data get to read values into scoreboards and /data merge/modify to change the world precisely.
When to use it: Use /data to read or edit the raw NBT of entities, block entities and storage โ the deep end of command control.
At a glance
Syntax
/data get entity <target> [path]See it
What it does
Anatomy
Every part, explained
- 1
CommandRequired/dataGets, merges, or modifies NBT.
- 2
ActionRequiredgetUse get, merge, modify, or remove.
- 3
SourceRequiredentity <target>An entity, block, or storage.
- 4
NBT pathOptional[path]A specific value to read.
Your turn
Try it yourself
Copy & paste
Examples
/data get entity @sShow all of your NBT.
/data get entity @s HealthRead your current health.
/data merge entity @s {NoGravity:1b}Disable your gravity.
Avoid these
Common mistakes
/data get @s/data get entity @sSay the source type: entity, block, or storage.
/data entity @s get/data get entity @sThe action comes before the source.
Good to know
Frequently asked questions
- How do you read an entity's NBT data?
- Run /data get entity <target> [path], e.g. /data get entity @s Health shows your current health value.
- How do you change a block entity's data?
- Use /data merge block <x> <y> <z> {...} to merge NBT into a chest, sign or other block entity.
- What is data storage in /data?
- Storage is a namespaced NBT container not tied to any block or entity โ datapacks use /data ... storage to hold variables and pass values around.
Keep going