Skip to main content

/data

Gets, merges, modifies, or removes NBT data from entities, block entities, or storage. A powerful command for advanced data manipulation.

Category
Data
Permission Level
Game Master
Version Added
1.13

Syntax

/data <get|merge|modify|remove> <target> <path> [<value>]

Parameters

NameTypeRequiredDescription
actionliteralRequiredget, merge, modify, or remove.
targetdata_targetRequiredThe target: entity <selector>, block <pos>, or storage <id>.
pathnbt_pathOptionalThe NBT path to operate on.
valuenbtOptionalThe NBT value to set or merge.

Examples

/data get entity @s Inventory

Displays your full inventory as NBT data.

/data merge entity @e[type=villager,limit=1,sort=nearest] {Invulnerable:1b}

Makes the nearest villager invulnerable.

/data modify storage my_namespace:my_data scores append value 100

Appends the value 100 to the 'scores' list in a custom data storage.

Common Mistakes

Notes

The 'storage' target type provides persistent key-value storage in the world data. Player entities have restrictions on which NBT fields can be written. Block entity data can be read and modified for things like signs, chests, and command blocks.

Related Commands

Need a Minecraft server?

Try these commands on Astroworld or host your own server.

Try Astroworld Hosting