Custom playerheads skins

Discussion in 'Plugin Development' started by Badwolf330, Feb 17, 2016.

Thread Status:
Not open for further replies.
  1. Offline


    is there any why to make a playerhead with a skin from a link? i did grab this code from internet

     public static ItemStack getCustomSkull(String url) {
            GameProfile profile = new GameProfile(UUID.randomUUID(), null);
            PropertyMap propertyMap = profile.getProperties();
            if (propertyMap == null) {
                throw new IllegalStateException("Profile doesn't contain a property map");
            byte[] encodedData = base64.encode(String.format("{textures:{SKIN:{url:\"%s\"}}}", url).getBytes());
            propertyMap.put("textures", new Property("textures", new String(encodedData)));
            ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
            ItemMeta headMeta = head.getItemMeta();
            Class<?> headMetaClass = headMeta.getClass();
            Reflections.getField(headMetaClass, "profile", GameProfile.class).set(headMeta, profile);
            return head;
    that works for this:

    but it isn't working for this:

    does someone knows a athor way?
  2. Offline


    @Badwolf330 Holy complications...

    Minecraft only has two ways to catch skins:
    • From a player name
    • From a player's UUID
    Nothing else will work, sorry. A URL to a skin site is not considered a profile. If that was allowed, Minecraft would be the most un-secure game ever.
  3. Offline


    Maybe it is possible in some way.
  4. Offline


  5. Offline


    I don't see anything in here saying I can't do reflection to do some magic.
  6. Offline


Thread Status:
Not open for further replies.

Share This Page