Помогите Изменить скин головы

  • Автор темы Автор темы Mukiroku
  • Дата начала Дата начала

Mukiroku

Активный участник
Пользователь
Баллы
76
Имя в Minecraft
Kukuroku
Как можно изменить скин головы без мотодов setOwner а через setPropertues. в интернете через url в виде textures.minecraft.net но его очень геморно получить если есть uuid или nick. Подскажите как можно быстро это делать?
 
Необходим 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;
    }
 
Необходим 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;
    }
Необходим 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?
 
Как получить url скина у игрока (любого) или как должен выглядеть value?
Ты хочешь устанавливать голове скин по лицензионному UUID, правильно я тебя понял?
А чем установка по лицензионному нику не устраивает?
 
Последнее редактирование:
Может есть способ изменить скин из файла .png?(не брать скин из minecraft textures)
 
Может есть способ изменить скин из файла .png?(не брать скин из minecraft textures)
Без модов нельзя.
Только костылём - грузишь свой скин на лицзионный аккаунт и получаешь его голову.
Можешь использовать свой аккаунт или воспользоваться чужим: https://mineskin.org/
 
Может есть способ изменить скин из файла .png?(не брать скин из minecraft textures)
Залить на свой аккаунт с сохранить пропертис скина. И так можно до бесконечности делать. Так работает система скинов еле.пи.
 
Назад
Верх