Minecraft – How Do I Get The NBT Data a Specific Block

minecraft-commandsminecraft-java-edition

I want to get the NBT data of a block as a string e.g. The NBT data of a chest. I know that this is possible as I had to do it a year or so ago for a key to a house I had built.

Best Answer

You can use the /blockdata command to see tile entity data. Providing no input will show the current state of that data. For instance, stand on top of a chest and run the following:

/blockdata ~ ~-1 ~ {}