Solved Player Heads in Inventory not updating

Discussion in 'Plugin Development' started by Grossen, May 26, 2015.

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

    Grossen

    Code:
    public void openShopInv(Player player){
        
            Inventory inv = Bukkit.getServer().createInventory(null, 54, ChatColor.GOLD + "HeadShop");
            loadHeads();
            for(ItemStack is : heads){
                inv.setItem(y, is);
                y = y +1;
            }
            player.openInventory(inv);
            player.updateInventory();
        }
    
        public void loadHeads(){
        
            for(String s : fm.getHeadTemp().getKeys(false)){
                for(String d : fm.getHeadTemp().getConfigurationSection(s).getKeys(false)){
                    ItemStack is = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
                    SkullMeta skullMeta = (SkullMeta) Bukkit.getItemFactory().getItemMeta(Material.SKULL_ITEM);
                    skullMeta.setOwner(fm.getHeadTemp().getString(s + "." + d + ".ownerOfHead"));
                    skullMeta.setLore(Arrays.asList(ChatColor.GRAY + "Price: " + ChatColor.GREEN + fm.getHeadTemp().getInt(s + "." + d + ".price")));
                    is.setItemMeta(skullMeta);
                    heads.add(is);
                    System.out.println(fm.getHeadTemp().getString(s + "." + d + ".ownerOfHead"));
                    System.out.println(fm.getHeadTemp().getInt(s + "." + d + ".price"));
                }
            }
        
        }
    How do i so the "skin" appear on the heads (I have set the owner of all heads)?



    2015-05-26_17.50.13.png
     
    Last edited: May 26, 2015
  2. @Grossen This is a limitation of Minecraft. It won't fetch the skins for heads that are in item form, only for ones that are placed in the world.
     
  3. Offline

    Grossen

    @AdamQpzm But they can do it on hypixel?
    2015-05-26_18.07.23.png

    Nvm, solved it

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
  4. Offline

    TheFl4me

    I am having the same issue could you tell me how you solved it?
     
Thread Status:
Not open for further replies.

Share This Page