Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Client Commands Wiki › Guides › How to Read NBT Data of Blocks and Entities with /cgetdata

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

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.