Solved How to load in a custom head

Discussion in 'Spigot Plugin Development' started by craterhater, May 14, 2017.

  1. Hey,

    I once tried loading up custom heads by running skull.setOwner(OWNER); on a SkullMeta but I read online that you need to download the skull first and add it to your world. Is there a way to get around this? Anyone mind showing me how they did custom skulls?

    Thanks!
     
  2. Hey,
    you don't need to download any textures, this is going automatically.
     
  3. Mhm, last time I tried it didn't work. I'll try it again
     
  4. Code (Text):
    public void owl(Location loc){
            ArmorStand a = (ArmorStand) loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
            ItemStack is = new ItemStack(Material.SKULL_ITEM,1,(byte)3);
            SkullMeta km = (SkullMeta) is.getItemMeta();
            km.setOwner("xBenji118x");
            is.setItemMeta(km);
            a.setHelmet(is);
        }
    This doesn't display the custom head
     
  5. Wait a second... it suddenly worked. Thanks!