Human Head on a skull

Discussion in 'Spigot Plugin Development' started by TcFoxy, May 27, 2015.

  1. Here's my code:
    Code (Text):
            public void setSkullItem(){
                ItemStack skull = new ItemStack(Material.SKULL_ITEM);
                SkullMeta meta = (SkullMeta) skull.getItemMeta();
                meta.setOwner(p.getName());
                skull.setItemMeta(meta);
                skullitem = skull;
                setSkullLore();
            }
           
            private void setSkullLore() {
                ItemStack skull = skullitem;
                ItemMeta meta = skull.getItemMeta();
                List<String> lore = Arrays.asList(new String[]{ChatColor.DARK_GREEN + "Current Level:", ChatColor.DARK_PURPLE + tier.toString()});
                meta.setLore(lore);
                skull.setItemMeta(meta);
                skullitem = skull;
            }
    why is it, that when i look in the chest, all of the skulls are skeleton skulls, instead of player skulls? I thought setOwner() is supposed set the skull to have the player's skin...
     
  2. Do this:
    Code (Text):
    ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
    This does the human head.
     
    • Like Like x 1