[1.13.2] Custom heads

Discussion in 'Plugin Development' started by SirNinjaHusky, Jun 15, 2019.

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

    SirNinjaHusky

    I am trying to get a custom head using the UUID from this site:
    https://minecraft-heads.com/custom-heads/decoration/597-urn

    When trying to give it to the player via a command all I get is the basic Steve head. All the tutorials I can find on player heads use the depreciated MATERIAL.SKULL_ITEM and not the new PLAYER_HEAD so I think I am just doing something wrong. Below is what I currently have:

    Code:
            if(sender instanceof Player){
    
                Player player = (Player)sender;
                ItemStack item = new ItemStack(Material.PLAYER_HEAD);
                SkullMeta meta = (SkullMeta)item.getItemMeta();
                meta.setOwningPlayer(Bukkit.getPlayer(UUID.fromString("23077a1b-183a-438c-bc14-e01a8d0381a1")));
                meta.setDisplayName("Urn");
                item.setItemMeta(meta);
    
                player.sendMessage(ChatColor.GREEN + "You have been given " +  ChatColor.YELLOW + "an urn!");
                player.getInventory().addItem(item);
    
            }
     
  2. Offline

    Kars

    Don't really have experience with this but you can give people playerheads through commands in vanilla. Last time i checked that worked. You could simply execute the give command instead of doing it manually.
    Sort of a bad workaround but it's all i got.
     
  3. Offline

    SirNinjaHusky

    Not really what I was looking for as the UUID as far as I can tell has no playername associated.
     
  4. Offline

    Kars

  5. Offline

    SirNinjaHusky

    Unless I am doing something wrong (dont think I am as I managed to get my UUID and name) the custom head I wanted from my OP doesnt have a playername associated.

    I dunno how the texture is applied to the block as the codes work fine when given via commandblock.
    If anyone figures out how to work it via code then I'd love to know but I will just use a custom item for now.
     
  6. Offline

    SirNinjaHusky

    I did find that yesterday but I couldnt get it to work due to GameProfile not being recognised aswell as the top 4 imports.

    Basae64 is also a problem as Base64.encodeBase64 gives an error too
     
Thread Status:
Not open for further replies.

Share This Page