How to edit NBT data in Minecraft
Type /data get entity @p Health in chat as an operator to read a value, or use /data merge to change NBT on blocks and entities.
data
Reads, merges, changes or removes NBT data on blocks, entities and command storage.
/data <get|merge|modify|remove> <block <pos>|entity <target>|storage <id>> [<path>] ... Examples
/data get entity @p Health Shows the nearest player's health.
/data merge entity @e[type=minecraft:villager,limit=1,sort=nearest] {NoAI:1b} Freezes the closest villager.
/data modify storage mymap:settings round set value 1 Stores a value in command storage.
Arguments
sourceRequiredblock <pos>,entity <target>orstorage <id>.pathOptional- NBT path, for example
HealthorItems[0]. nbtOptional- Compound to merge, in
{ }.
What it does
get prints data (or one path of it), merge combines a compound into the existing data, modify sets, appends, prepends, inserts or merges at a path from a value, another source or a computed number, and remove deletes a path. Player data can be read but not changed this way; use other commands like item or attribute for players.
Good to know
- Needs operator permission level 2.
Run it on your server
On a SLASHPLAY server, type it in the Console tab without the leading slash; in game, operators type it in chat with the slash. New to this? Start a Minecraft server first.
Your own
Minecraft server.
From $0.03 an hour, only while it runs. New accounts get 6 free tokens.