private BaseComponent[] getBaseComponentMessage(final Player p, final ItemStack is) { final Class<?> craftItemClazz = ReflectionUtil.getCBClass("inventory.CraftItemStack"); final Class<?> nmsItemStackClazz = ReflectionUtil.getNMSClass("ItemStack"); final Class<?> nmsNBTTagCompoundClazz = ReflectionUtil.getNMSClass("NBTTagCompound"); if (craftItemClazz == null || nmsItemStackClazz == null || nmsNBTTagCompoundClazz == null) return null; final Method asNMSMethod; final Method saveNMSItemStackMethod; final Object nmsItemStack; final Object finalNMSItemStack; try { asNMSMethod = craftItemClazz.getMethod("asNMSCopy", ItemStack.class); saveNMSItemStackMethod = nmsItemStackClazz.getMethod("save", nmsNBTTagCompoundClazz); nmsItemStack = asNMSMethod.invoke(null, is); finalNMSItemStack = saveNMSItemStackMethod.invoke(nmsItemStack, nmsNBTTagCompoundClazz.newInstance()); } catch (ReflectiveOperationException ex) { return null; } return new ComponentBuilder("[Event]") .color(net.md_5.bungee.api.ChatColor.LIGHT_PURPLE) .append(" Der Spieler ") .color(net.md_5.bungee.api.ChatColor.GREEN) .append(p.getName()) .append(" verteilt ") .color(net.md_5.bungee.api.ChatColor.GREEN) .append("dieses Item") .color(net.md_5.bungee.api.ChatColor.DARK_GREEN) .underlined(true) .event( new HoverEvent( HoverEvent.Action.SHOW_ITEM, new BaseComponent[] {new TextComponent(finalNMSItemStack.toString())})) .append("!") .color(net.md_5.bungee.api.ChatColor.GREEN) .underlined(false) .create(); }