Structure
NBT Data can be accessed with data
command, we well as data
argument of execute
command.
We are going to use NBT Paths a lot, so it is important to understand them. It is simpler to imagine NBT as a tree, that has leaves (elements) and root (entity/block/storage).
Graph 1: NBT Data of a real Item Frame, that has a bucket inside
In this example we have Pos
, which is an array with coordinates XYZ and Item
that corresponds to the item inside Item Frame. It has values id
(string), Count
(bytes) and tag
(object | optional)
There are a couple of types you must understand:
- String - any symbols between two
"
- Byte (
b
) - 8-bit number, stores integer numbers in range[-128; 127]
- Short (
s
) - 16-bit number, stores integer numbers in range[-32,768; 32,767]
- Integer - 32-bit number, stores integer numbers in range
[-2,147,483,648; 2,147,483,647]
- Long (
L
) - 64-bit number, stores integer numbers in range[-9,223,372,036,854,775,808; 9,223,372,036,854,775,807]
- Float (
f
) - 32-bit number, stores numbers with floating point with approximately7
decimal digits - Double (
d
) - 64-bit number, stores numbers with floating point with approximately16
decimal digits