NBT-API

NBT-API

98.9k Downloads

convert nbt into itemstack

pawelkuwa opened this issue ยท 3 comments

commented

hi i have problem, i cant find solution for my problem. i want to convert nbt tags from string exactly into itemstack ingame.
at first i must to create compound of nbt but i can't find how.
can you help me with this problem?

i want to translate string text with nbt into nbtcompound for get item from nbt compound.
thank you for attention.

commented

https://github.com/tr7zw/Item-NBT-API/wiki/Converting-Minecraft-Objects-to-NBT-and-Strings

ItemStack rebuild = NBTItem.convertNBTtoItem(new NBTContainer(string));

commented

Caused by: java.lang.ClassNotFoundException: de.tr7zw.nbtapi.NBTCompound
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:151) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:103) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
... 23 more

by code:
NBTContainer slot1Nbt = new NBTContainer(CreatePlayerFile.getShulkSlot(player, 1)); slot1 = NBTItem.convertNBTtoItem(slot1Nbt);

commented

Class not found = you didn't put the plugin into the plugins folder.