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.

检测类型
方块实体NBT标签目标方块实体的NBT标签

输出: NBT

    Operator(运算符)
    NBT Compound Value CompoundNBT{}.get_compoundThe Compound value in the given NBT compound tag with the given key
    • NBT
    • String(字符串)
    • NBT
    Global name: nbtGetCompound(NBTString(字符串)) → NBTMethod name: NBT.getCompound(String(字符串)) → NBT
    Operator(运算符)
    NBT Path Match FirstNBT.path_match_firstApply the given NBT Path expression on the given NBT value, and return the first match
    • String(字符串)
    • NBT
    • NBT
    Global name: stringNbtPathMatchFirst(String(字符串)NBT) → NBTMethod name: String(字符串).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
    变量卡30
    机器读取器5
    显示器5