(1.9) Player Heads

Discussion in 'Spigot Plugin Help' started by MaxNatural, May 26, 2016.

  1. I am trying to set the helmet to a player head by username. Here is the code.

    Code (Text):
            case SKULL_ITEM:
                ItemStack mSkull = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
                SkullMeta msMeta = (SkullMeta)mSkull.getItemMeta();
                msMeta.setDisplayName(ChatColor.GREEN + "" + ChatColor.BOLD + "MaxNatural' Head");
                msMeta.setOwner("MaxNatural");
                List<String> msLore = new ArrayList<String>();
                msLore.add(ChatColor.GRAY + "" + ChatColor.ITALIC + "wat");
                msMeta.setLore(msLore);
                mSkull.setItemMeta(msMeta);
             
                player.getInventory().setHelmet(mSkull);
                player.closeInventory();
                }
    The player skin does now show for some reason :/
     
    #1 MaxNatural, May 26, 2016
    Last edited: May 26, 2016