Wiki 9Minecraft Wiki 9Minecraft

How to Read NBT Data of Blocks and Entities with /cgetdata

Java EditionModGuides 4FAQ 10Related mods 48
DownloadClient Commands Mod

Get the files on 9Minecraft

Contents (4)
  1. Why you would use it
  2. Step by step
  3. Reading the output
  4. Tips

Why you would use it

/cgetdata prints the NBT (the structured data tag) of whatever block entity or entity you target. This is what you reach for when you want to check a chest's contents in text form, inspect a mob's attributes, verify a spawner's settings, or debug a redstone component without a separate NBT viewer.

Step by step

1. Look directly at the block entity (chest, furnace, spawner, sign, hopper, etc.) or entity you want to inspect. Keep it in your crosshair.

2. Run /cgetdata. The command reads the target under your cursor.

3. The NBT is printed to chat. Long tags may be truncated or wrapped; if your client supports copying chat, copy the line out to read it comfortably.

4. To inspect a specific entity instead of whatever you are aiming at, use the command's entity argument form and supply a selector or name.

Reading the output

  • Look for the tag names you care about: Items for container contents, id for the type, Pos for coordinates, and mob-specific tags for attributes.
  • Values are shown as key/value pairs. Numbers, strings, and nested compound tags are all visible.

Tips

  • This is read-only; it does not modify anything, so it is safe to run anywhere.
  • If nothing prints, you are probably not aiming at a valid block entity or entity. Step closer and re-aim.

More guides for this mod