All commands
๐Ÿงฌ
AdvancedJava โœ“Bedrock -

/data

View or change the hidden NBT data of entities and blocks.

๐ŸชจThis command is Java Edition only - Bedrock has no direct equivalent.

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

Syntax
/data get entity <target> [path]
commandtargetcoordsvaluerequiredoptional

See it

What it does

{
Health:14.0f20.0fโœ“
OnGround:0b1bโœ“
NoAI:0b1bโœ“
}
Reading and rewriting raw NBT

Anatomy

Every part, explained

  1. 1
    /dataCommandRequired

    Gets, merges, or modifies NBT.

  2. 2
    getActionRequired

    Use get, merge, modify, or remove.

  3. 3
    entity <target>SourceRequired

    An entity, block, or storage.

  4. 4
    [path]NBT pathOptional

    A specific value to read.

Your turn

Try it yourself

Playground
4 tokens ยท press Enter to run

Copy & paste

Examples

/data get entity @s

Show all of your NBT.

/data get entity @s Health

Read your current health.

/data merge entity @s {NoGravity:1b}

Disable your gravity.

Avoid these

Common mistakes

โœ•/data get @s
โœ“/data get entity @s

Say the source type: entity, block, or storage.

โœ•/data entity @s get
โœ“/data get entity @s

The 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

Related commands