OGTOOLS

Minecraft /data command

Views, changes, copies or removes NBT data.

⚙️ Advanced commands Operator (level 2) Needs cheats enabled Java Edition 26.3

Syntax

/data get entity <target> [<path>]
/data get block <targetPos> [<path>]
/data merge entity <target> <nbt>
/data modify entity <target> <targetPath> set value <value>
/data remove entity <target> <path>

Parts in square brackets are optional, parts in angle brackets are required. You do not type the brackets: Put your own value in their place.

Arguments

ArgumentWhat it does
entity / block / storage The data source: An entity, a block or command storage.
<path> The name of a field in the data, for example Health or Inventory[0].id

Examples

/data get entity @s

Dumps all of your data into chat.

/data get entity @s Pos

Prints your position with decimals.

/data merge block ~ ~-1 ~ {CustomName:"Vault"}

Names the chest beneath you.

Good to know

  • If you write a wrong path the command fails, but no data is corrupted.
  • The most powerful tool for command block and data pack makers.

How do I run this command?

Press T in game to open chat (or press / directly), type the command and press Enter. While typing, Tab completes the options. This command counts as a cheat: It needs cheats enabled in a singleplayer world, and operator permission on a server (operator (level 2)).

Related commands

⚙️ More Advanced commands

Another tool Minecraft crafting recipes Would rather make the item than give it with a command? See the recipe on the 3x3 grid.

Minecraft is a product of Mojang Studios. This tool is an independent helper made for players and is not affiliated with Mojang or Microsoft.