Следуйте инструкциям в видео ниже, чтобы узнать, как установить наш сайт как веб-приложение на главный экран вашего устройства.
Примечание: Эта функция может быть недоступна в некоторых браузерах.
public static ItemStack getHeadByUrl(String url) {
return getHeadByTextureData(
"{\"textures\":{\"SKIN\":{\"url\":\"https://textures.minecraft.net/texture/" + url + "\"}}}",
false
);
}
public static ItemStack getHeadByTextureData(String value, boolean base64) {
PlayerProfile profile = new CraftPlayerProfile(new GameProfile(UUID.randomUUID(), null));
if (!base64)
value = new String(Base64.getEncoder().encode(value.getBytes()));
profile.setProperty(new ProfileProperty("textures", value));
return createPlayerHeadWithProfile(profile);
}
private static ItemStack createPlayerHeadWithProfile(PlayerProfile profile) {
ItemStack head = new ItemStack(Material.PLAYER_HEAD);
if(profile != null) {
SkullMeta headMeta = (SkullMeta) head.getItemMeta();
headMeta.setPlayerProfile(profile);
head.setItemMeta(headMeta);
}
return head;
}
Необходим PaperSpigot
PHP:public static ItemStack getHeadByUrl(String url) { return getHeadByTextureData( "{\"textures\":{\"SKIN\":{\"url\":\"https://textures.minecraft.net/texture/" + url + "\"}}}", false ); } public static ItemStack getHeadByTextureData(String value, boolean base64) { PlayerProfile profile = new CraftPlayerProfile(new GameProfile(UUID.randomUUID(), null)); if (!base64) value = new String(Base64.getEncoder().encode(value.getBytes())); profile.setProperty(new ProfileProperty("textures", value)); return createPlayerHeadWithProfile(profile); } private static ItemStack createPlayerHeadWithProfile(PlayerProfile profile) { ItemStack head = new ItemStack(Material.PLAYER_HEAD); if(profile != null) { SkullMeta headMeta = (SkullMeta) head.getItemMeta(); headMeta.setPlayerProfile(profile); head.setItemMeta(headMeta); } return head; }
Как получить url скина у игрока (любого) или как должен выглядеть value?Необходим PaperSpigot
PHP:public static ItemStack getHeadByUrl(String url) { return getHeadByTextureData( "{\"textures\":{\"SKIN\":{\"url\":\"https://textures.minecraft.net/texture/" + url + "\"}}}", false ); } public static ItemStack getHeadByTextureData(String value, boolean base64) { PlayerProfile profile = new CraftPlayerProfile(new GameProfile(UUID.randomUUID(), null)); if (!base64) value = new String(Base64.getEncoder().encode(value.getBytes())); profile.setProperty(new ProfileProperty("textures", value)); return createPlayerHeadWithProfile(profile); } private static ItemStack createPlayerHeadWithProfile(PlayerProfile profile) { ItemStack head = new ItemStack(Material.PLAYER_HEAD); if(profile != null) { SkullMeta headMeta = (SkullMeta) head.getItemMeta(); headMeta.setPlayerProfile(profile); head.setItemMeta(headMeta); } return head; }
Ты хочешь устанавливать голове скин по лицензионному UUID, правильно я тебя понял?Как получить url скина у игрока (любого) или как должен выглядеть value?
https://sessionserver.mojang.com/session/minecraft/profile/uuid?unsigned=trueКак получить url скина у игрока (любого) или как должен выглядеть value?
Та ему это не нужно. По идее setOwner всё сделает сам. Но ХЗ, как с ним на offline-mode. Возможно косяк как раз в моде
Без модов нельзя.Может есть способ изменить скин из файла .png?(не брать скин из minecraft textures)
Залить на свой аккаунт с сохранить пропертис скина. И так можно до бесконечности делать. Так работает система скинов еле.пи.Может есть способ изменить скин из файла .png?(не брать скин из minecraft textures)