Skip to content

NBT

Provides a storage for storing arbitrary NBT data.

Type ID: kaya:nbt

Tip

This type is to be used in conjunction with the following to query/modify its contents:

Type Details
/data ... kaya:power command This can query/modify the contents of the power.
kaya:power NBT provider This can query the contents of the power and provide it as an NBT value.

Format

No additional fields.

Warning

This type does not support the active_condition field.

Example

{
    "type": "kaya:nbt"
}
#   Set the contents of the 'example:data' power
data merge kaya:power @s example:data {value: "Hello world!", cool_items: [{id: "minecraft:egg", count: 1}, {id: "minecraft:diamond", count: 1}]}

#   Count how many elements are in the 'cool_items' NBT of the 'example:data' power
execute store result score #stacks example if data kaya:power @s example:data cool_items[]

#   Display how many item stacks are in the 'cool_items' NBT of the 'example:data' power
tellraw @a ["There are ", {"score": {"name": "#stacks", "objective": "example"}}, " cool item stack(s)!"]

This example provides a power to be used as a storage for NBT data and a function file that would set and display some of its contents.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.