NBT API ruining use of components in item meta
Nuckerr opened this issue ยท 2 comments
Hello, I am running this code:
NBTItem nbt = new NBTItem(item);
nbt.setString("button", id.toString());
item = nbt.getItem();
this.item = item;
and the item has this meta:
ItemStack item = new ItemStack(Material.NAME_TAG);
ItemMeta meta = item.getItemMeta();
meta.displayName(Component.text(tag.getName()).color(NamedTextColor.GREEN));
List<Component> lore = new ArrayList<>();
lore.add(Component.empty());
lore.add(Component.text("&Your tag will look like: "));
lore.add(tag.getDisplay());
lore.add(Component.empty());
meta.lore(lore);
meta.setLocalizedName(tag.getName());
if(this.getPlayerTag(player).equals(tag)) {
meta.addEnchant(Enchantment.BINDING_CURSE, 1, true);
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
item.setItemMeta(meta);
However all of the meta just appears as this:
Browsing the code, there dosent seem to be any reason for this to be happening except when I put my item through NBT API.
I'm honestly not too sure what you mean? What would you expect it to look like, and how does having the item in NBTItem form change that^^?