Runtime and editor objects

CustomItemRuntime object

Object to store current item runtime state. It have:

  • Binded item stack (bindedItemStack)

  • Binded CustomItem to item stack (instanceItem)

  • Editor (editor)

ItemEditor object

Simple wrapper for ItemMeta with more simple ways to edit item and its nbt tags. Important thing that TailsLib using Persistent Data Container for containing any NBT Data.

Creating ItemEditor

Use constructor for this.

ItemEditor editor = new ItemEditor(itemStack);

Setting NBT Tags

ItemEditor editor = new ItemEditor(itemStack);
NamespacedKey key = new NamespacedKey("namespace", "keyId");
editor.setNBT(key, PersistentDataType.STRING, "data");

Getting NBT Tags

Other methods

The remaining methods of the editor are self-explanatory and do not require description. Just ask your IDE for help and read JavaDoc.

Last updated