NBT
NBT tags are used to represent complex datastructures. These are typically used internally in Minecraft to store machine and entity information. In this tutorial, we will go over simple NBT tag reading and manipulation
As a first step, use a Block Reader on a lectern, read its NBT data, and visualize it in a Display Panel.
Next, from the read Lectern NBT tag, read the Book sub-tag as a compound tag, and visualize it.
As a final step, we will read the id field from this Book sub-tag. However, instead of starting from our last read sub-tag, we will start from the root, and apply an NBT Path expression. Such expressions are useful to get deeply nested NBT values. For example, applying the expression ”.root.child1.child2” on the NBT tag { root: { child1: { child2: ”some value” } }} will output ”some value”. More advanced features of NBT Path are described later in the advanced part of the manual.
To accomplish the final advancement, create an NBT Path expression that selects the Book/id field, apply it on our Lectern tag, and visualize it in a Display Panel.
Output: NBT
- NBT
- String
- NBT
- String
- NBT
- NBT
- Lectern NBTRead the NBT tag from a machine using a Block Reader, such as the Lectern.
- Lectern NBT BookRead the Book NBT field inside a Lectern block on the NBT tag read from a Block Reader.
- Lectern NBT Book NameRead the name (id) of a book inside a Lectern block by applying an NBT Path expression on the NBT tag read from a Block Reader.