So I'm going to make a gui status of the player so I have an inventory made I just wanted to get the viewers of the gui then set them the owner of the skull itemstack but even their skull is not appearing I used InventoryOpenEvent Code (Java): Player p = (Player) e.getPlayer(); ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal()); SkullMeta sm = (SkullMeta)skull.getItemMeta(); sm.setOwner(p.getName()); sm.setDisplayName(plugin.colorize("&e&lStatus")); Glow glow = new Glow(70); sm.addEnchant(glow, 1, true); skull.setItemMeta(sm); inv.setItem(0, skull);
Why do you use p.getname(), why not p.toString(); ? I guess it doesn't really matter but idk, I will try to help you when I get home if you haven't achieved the goal yet
fixed already by myself my bad I used this code as an alternative way Code (Java): e.getInventory().setItem(0,skull);
Try this: Code (Text): ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short) 3); SkullMeta metahead = (SkullMeta) head.getItemMeta(); metahead.setOwner(p.getName()); metahead.setDisplayName(plugin.colorize("&e&lStatus")); head.setItemMeta(metahead); Glow glow = new Glow(70); headmeta.addEnchant(glow, 1, true); inv.setItem(0, head);
this is like exact the same code op has... also, you code doesn't work since you add the enchantment after reappling the meta.
I don't change the line where I put the inv.setItem thingyy thats what I did I forgot to tell that I change it to (short)3 and always check the prefix before commenting