function to parse item in chat with lore
Twi5TeD opened this issue ยท 1 comments
atm im using
Player player = (Player) sender;
ItemStack i = player.getInventory().getItemInMainHand();
CraftItemStack stack = CraftItemStack.asCraftCopy(i);
net.minecraft.server.v1_12_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack);
NBTTagCompound tagCompound = new NBTTagCompound();
nmsStack.save(tagCompound);
TextComponent textComponent = new TextComponent(ChatColor.translateAlternateColorCodes('&', "&f" + sender.getName() + " &7is showcasing &b[" + fullName(i, player.getInventory().getContents()) + "&b]"));
textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new ComponentBuilder(tagCompound.toString()).create()));
p.spigot().sendMessage(textComponent);
to show the item in chat with lore for 1.12 but i wont other client version to be able to see them aswell