How to Use the Data Command in Minecraft

This Minecraft tutorial explains how to use the /data command with screenshots and step-by-step instructions.

You can use the /data command to get, merge and remove NBT tags (formerly called data tags) for entities and block entities. The /data command is most useful for changing attributes of a mob after the mob has spawned or modifying attributes of a block entity after you have placed it.

TIP: Starting in Minecraft Java Edition (PC/Mac) 1.13, the /data command replaces both the /entitydata command and the /blockdata command.

Let's explore how to use this cheat (game command).

Supported Platforms

The /data command is available in the following versions of Minecraft:

PlatformSupported (Version*)
Java Edition (PC/Mac) Java Edition (PC/Mac)Yes (1.13)
Pocket Edition (PE) Pocket Edition (PE)No
Xbox 360 Xbox 360No
Xbox One Xbox OneNo
PS3 PS3No
PS4 PS4No
Wii U Wii UNo
Nintendo Switch Nintendo SwitchNo
Windows 10 Edition Windows 10 EditionNo
Education Edition Education EditionNo

* The version that it was added or removed, if applicable.
NOTE: Pocket Edition (PE), Xbox One, PS4, Nintendo Switch, and Windows 10 Edition are now called Bedrock Edition. We will continue to show them individually for version history.

Requirements

To run game commands in Minecraft, you have to turn cheats on in your world.

Data Command

Examples

How to Enter the Command

1. Open the Chat Window

The easiest way to run a command in Minecraft is within the chat window. The game control to open the chat window depends on the version of Minecraft:

  • For Java Edition (PC/Mac), press the T key to open the chat window.

2. Type the Command

In this example, we are going to retrieve all of the NBT information for a block entity such as a chest.

To get the NBT tags for a chest at the coordinates (329, 68, 91), we would type the following command in Minecraft Java Edition (PC/Mac) 1.13:

/data get block 329 68 91

Type the command in the chat window. As you are typing, you will see the command appear in the lower left corner of the game window. Press the Enter key to run the command.

data command

Once the cheat has been entered, all of the NBT tags will be listed in the lower left corner of the game window.

completed data command

In this example, the /data command returns the following NBT tags for the chest at 329, 68, 91:

329,68,91 has the following block data:{x:329,y:68,z:91,
Items:[{Slot:0b,id:"minecraft:diamond_sword",Count:1b,tag:{
Damage:0}},{Slot:1b,id:"minecraft:iron_helmet",Count:1b,tag:
{Damage:0}},{Slot:2b,id:"minecraft:iron_chestplate",Count:1
b,tag:{Damage:0}},{Slot:3b,id:"minecraft:iron_leggings",
Count:1b,tag:{Damage:0}},{Slot:4b,id:"minecraft:iron_boots",
Count:1b,tag:{Damage:0}}],id:"minecraft:chest",Lock:""}

Now we can see the x y z coordinates of the chest, all of the items inside the chest (ie: diamond sword, iron helmet, iron chestplate, iron leggings and iron boots) and the lock information for the chest.

Congratulations, you have learned how to use the /data command in Minecraft.