Skull appearing as default skin

Discussion in 'Plugin Development' started by nelson2tm, Jun 2, 2016.

Thread Status:
Not open for further replies.
  1. Offline



    I am trying to create a inventory GUI with a skull which has a player skin. I've tried multiple things, but the skulls keep appearing as the default Steve skin. What did I do wrong here? online-mode is true on my private localhost server.

            ItemStack Toverstaf14 = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
            SkullMeta Toverstaf14Meta = (SkullMeta) Toverstaf14.getItemMeta();
            Toverstaf14Meta.setDisplayName(ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "Title");
            ArrayList<String> Toverstaf14Lore = new ArrayList<String>();
            Toverstaf14Lore.add(ChatColor.GRAY + "Lore1");
            Toverstaf14Lore.add(ChatColor.GRAY + "Lore2");
            Toverstaf14Lore.add(ChatColor.GRAY + "Lore3");
            Toverstaf14Lore.add(ChatColor.GRAY + "" + ChatColor.ITALIC + "Lore4");
    The title and lores are appearing correctly. Also, when using the default Minecraft /give command, I can get the player skull without issues.
  2. Offline

    Mr. Sandwich

    I am not 100% sure but I think that the heads' texture only load when they are placed in the world or in the player's inventory
  3. Offline

    I Al Istannen

    @Mr. Sandwich
    Since 1.8 they render in every inventory. They may take a few seconds to sync though. Beofre that they just rendered if placed.

    You don't follow naming conventions. Variables should start with a lowercase letter and then be written in camelCase.

    From glancing at the SkullType enum, it isn't Player.ordinal(), but "3" casted to a short. Try this.
  4. Offline


    Here's something weird: If I place them they do render when placed on the ground, but the inventory one doesn't render. (Since I don't have a InventoryClickEvent added to the inventory menu yet, I can take items out.)


    @Mr. Sandwich I think you meant that the skull in the inventory only rendered the correct skin if placed in the world.
  5. Offline

    Mr. Sandwich

    nope, it renders when its in your inventory too
  6. Offline

    I Al Istannen

    I am on 1.8:
    Head renders.png
    And it works.

    The exact code I used is (itemStackBuilder is a class I made, just ignore it):
    ItemStack item = ItemStackBuilder
        .setDurability((short) 3)
        .setName(Util.color("&6" + loopPlayer.getDisplayName()))
        .setLore("&3(" + loopPlayer.getName() + ")")
    The setSkullOwner is just what you have:
            SkullMeta meta = (SkullMeta) item.getItemMeta();
            itemMeta = item.getItemMeta();
Thread Status:
Not open for further replies.

Share This Page