I want to create custom heads but I can't get any further. I have created the custom skull and so on but it does not set the new skin. Does anyone know what to do?
Java:
private ItemStack getSkull(String url) throws MalformedURLException {
UUID uuid = UUID.randomUUID();
PlayerProfile profile = Bukkit.createProfile(uuid);
PlayerTextures textures = profile.getTextures();
textures.setSkin(URI.create(url).toURL());
profile.setTextures(textures);
ItemStack head = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullMeta = (SkullMeta) head.getItemMeta();
skullMeta.setPlayerProfile(profile);
return head;
}
- Version Output
-
Current Purpur Version: 1.21.3-2358-16ce24a (MC: 1.21.3)*
* You are running the latest version