Integrated Dynamics - On the Dynamics of Integration

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.

Aspect
Blockentitetens NBTMålblockentiteten som NBT

Utmatning: NBT

    Operator
    NBT Compound Value CompoundNBT{}.get_compoundThe Compound value in the given NBT compound tag with the given key
    • NBT
    • Sträng
    • NBT
    Global name: nbtGetCompound(NBTSträng) → NBTMethod name: NBT.getCompound(Sträng) → NBT
    Operator
    NBT Path Match FirstNBT.path_match_firstApply the given NBT Path expression on the given NBT value, and return the first match
    • Sträng
    • NBT
    • NBT
    Global name: stringNbtPathMatchFirst(SträngNBT) → NBTMethod name: Sträng.nbtPathMatchFirst(NBT) → NBT
    Advancements
    • 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.
    Rewards
    Variabelkort30
    Maskinläsare5
    Skärmpanel5