Hey guys, my method dont set the Skin from URL
My Try
SkinURL
ItemSkulls.getSkull2("https://textures.minecraft.net/text...94500fc6402dafd17f3b4b18f1f9b2c8c01ed9adadccb", 1, "§8» §aVote-Belohnung");
My Try
SkinURL
ItemSkulls.getSkull2("https://textures.minecraft.net/text...94500fc6402dafd17f3b4b18f1f9b2c8c01ed9adadccb", 1, "§8» §aVote-Belohnung");
Java:
public static ItemStack getSkull1(String skinURL, int amount, String name) {
ItemStack skull = new ItemStack(Material.PLAYER_HEAD, 1);
skull.editMeta(itemMeta -> {
SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
PlayerProfile playerProfile = Bukkit.createProfile(UUID.randomUUID());
PlayerTextures playerTextures = playerProfile.getTextures();
try {
playerTextures.setSkin(new URL(skinURL));
}catch (MalformedURLException exception){
throw new RuntimeException(exception);
}
playerProfile.setTextures(playerTextures);
skullMeta.setPlayerProfile(playerProfile);
});
return skull;
}
- Version Output
- 1.21