Tutorial Create your own custom head texture

Discussion in 'Resources' started by bwfcwalshy, Jul 6, 2016.

Thread Status:
Not open for further replies.
  1. Hello everyone, I have been creating a plugin and using custom heads and I wanted to make a tutorial since I don't think there is one already on how to make your own custom head texture and how to implement it into your plugin.

    Have you ever wanted a head texture but couldn't find one? Did you not know how to make your own custom head textures? Well this tutorial will help you with that. So let's begin!

    Step 1
    First, we will want to make the texture, now these are simply player skins still. Download the Steve or Alex skins or even use your own, now just open these up in something like Paint.NET or Photoshop. Now you have the skins you want to find which parts are the head, these are which we will focus on.
    picture (open)
    [​IMG]


    Step 2
    Now once you have the skin downloaded and you know which parts to edit we can now start editing it. For this tutorial I will be making a head for the Computer Craft Mining Turtle, so I opened the Computer Craft mod and went to the assets folder to get the texture, you could just make this from scratch or you can get it from MC or a mod. So I shrank the skin and put it in place on the head textures, once you have also done the head texture how you want you can now advance to uploading and applying this skin to heads.
    picture (open)
    [​IMG]


    Step 3
    After the skin is done we want to know upload this to Minecraft, go to minecraft.net, login and navigate to your profile this is where we will upload the skin. Now, we do not need to keep this skin, once applied and we have the data we need you can change back. Upload your skin and once that is done we will need your UUID if you know it already you can advance to the next step, if not, continue reading. Go to namemc.com and search for your username, once you are at the page you will see your UUID, we want the one without dashes (-). Now you have the UUID advance to step 4
    picture (open)
    [​IMG]


    Step 4
    Now that we have your UUID we will need to get your skin data, go to https://sessionserver.mojang.com/session/minecraft/profile/<UUID> and input your UUID into the url. Once you are there you will need the base64 in the json, this is located after the "values". Copy that base64 and go to base64decode.org and put the base64 in there and decode it (If you are using it in your plugin, if you want it in game through /give go to step 6b)
    Show Spoiler
    [​IMG]


    Step 5
    Now we have the decoded base64 we will have a few things, we only need the texture URL, now there are 2 things you can do, step 6a is adding this skin in from your code and step 6b is getting this head in game.

    Step 6a
    To add this skull into the code we can use a util created by @TigerHix we can use the classes Reflections and Skull from the GitHub repo you can also just add this into your code but to make this tutorial a little simpler especially for those who are not used to reflection the util can be used. To add the skull to a players inventory we will use the Skull class and using the method getCustomSkull(String url), just add in the url you got from the decoded base64 into there.
    player.getInventory().addItem(Skull.getCustomSkull("<URL>");
    Example:
    Code:
    player.getInventory().addItem(Skull.getCustomSkull("http://textures.minecraft.net/texture/7c57f9192e81eb6897c24ecd4935cfb5a731a6f9a57abb51f2b35e8b4be7ebc");
    This would spawn in my custom skull which I created during this tutorial.

    Step 6b
    For step 6b we only need the base64 of the texture, once we have that we need to generate UUID. This can be done by going to a site like uuidgenerator.net or through Java by using UUID.randomUUID(). Once we have the UUID we will just put this into a give command
    Code:
    /give (player) 1 3 {SkullOwner:{Id:"<Input your UUID>",Properties:{textures:[{Value:"<Input the Base64>"}]}}}
    For example, my Computer Craft turtle
    Code:
    /give bwfcwalshy 1 3 {SkullOwner:{Id:"cdb80b53-7b46-441a-a85f-5f0f4d3baa9c",Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2M1N2Y5MTkyZTgxZWI2ODk3YzI0ZWNkNDkzNWNmYjVhNzMxYTZmOWE1N2FiYjUxZjJiMzVlOGI0YmU3ZWJjIn19fQ=="}]}}}
    Now you have officially made your own custom head texture and spawned it in game!!


    Thank you for reading, this is the first tutorial I have created on Bukkit so I hope you all like it. It was quite long but once you have read it once you realize it is not a very long process and can be done very quickly.
     
    Last edited: Jul 6, 2016
  2. Offline

    ArsenArsen

    FIRTS!
    Nice one @bwfcwalshy, but you came a bit late xD I really needed this a week ago, but I resolved it.

    EDIT: Its important to note that uuid is a1037a3c7e254f6bae386063f9d3daed not a1037a3c-7e25-4f6b-ae38-6063f9d3daed!
     
  3. @ArsenArsen :D Sorry! I was just doing it today and noticed that there was no resource so I decided to make a tutorial for it. Most people do not know how to do this.
     
  4. Offline

    ArsenArsen

    @bwfcwalshy. It's fine. You helped me many other times. But I was banging my head to the desk before i figured this one out:
    When I figured that I jumped into some water because my brain was on [fire] :D
    EDIT: Me in a nutshell that time:
    #ME (open)
    TOILET.gif giphy.gif
     
    Last edited: Jul 6, 2016
  5. Offline

    ArsenArsen

  6. Offline

    ChipDev

    Cool! I think I remember @TigerHix talking about this a while ago.
    Any chance this will be removed by *cough* Microsoft *cough* ?
     
  7. @ChipDev This should never be removed because of the way Mojang save skins, if they decided to no longer save the ones not in use this would no longer work and a lot of servers would have issues. Yeah sounds like a Microsoft thing to do.
     
  8. Offline

    ChipDev

    Yep.
    Oh, this is why they are able to retrieve skins! Make sense.
    INB4 skin retrieving is only for windows 10 >_>
    EDIT: Take a hug

    Edit $2: @bwfcwalshy Can we use this process to make custom NPC skins? Without creating new Minecraft accounts? :O
     
    Last edited: Jul 6, 2016
    bwfcwalshy likes this.
  9. Offline

    ArsenArsen

    Yes. Do the same but dont make it into a head but into a player.
     
    bwfcwalshy likes this.
  10. Offline

    ChipDev

    I have another question, just related to UUID's, how are they generated? Because lets say I have a custom skull, then Walshy somehow makes the exact same UUID and then puts in a different texture Base64. Will my skull change?
     
  11. Offline

    Zombie_Striker

    @ChipDev
    The second U in "UUID" stands for "Unique". From the "Universal Unique Identifier" wiki page:
    It is Far too unlikely to get the same UUID
     
  12. Offline

    ChipDev

    When you create an UUID, does it take any other actually unique parts of you in it, like your MAC address or IP address? I feel as if random is not enough.
     
  13. @ChipDev
    I do believe it is just a random base 64 number. But the chances of getting the same UUID twice are.. small. And even then, you could always (I'd assume mojang does this) check if that UUID has previously been used in your system.
     
  14. @ChipDev Having the same UUID is no issue, mc just needs an invalid UUID. You can have 2 different textures with the same UUID
     
  15. Offline

    Lordloss

    Wow didnt knew this, i thought 1 skin per acc. That possibilities!
     
  16. Offline

    MiningShark

  17. Offline

    Zombie_Striker

  18. Offline

    MiningShark

    Last edited: Feb 11, 2017
  19. Please Make This. Emperor Palpatine.png Thanks.
     
  20. Offline

    Zombie_Striker

    @YT_RainbowMustachio
    That's not why this thread is here. This is here to teach you how to do it. If you want that head, you have to read the thread and do what it says.
     
    ChipDev, bwfcwalshy and Rayzr522 like this.
  21. Offline

    kaaseigenaar

  22. Offline

    Zombie_Striker

  23. Offline

    kaaseigenaar

    Its works, Thank you!
     
  24. Could you post the problem? I still am receiving the error. The error message is that there is no such method as getCustomHead(String) for Skull.

    Solution:
    In this forum(https://www.spigotmc.org/threads/solved-custom-head-texture.74387/), IceGroose posted a Method that worked Marvelously. Just post it into code and to call on it do
    player.getInventory().addItem(getSkull("Your URL here."));​
     
    Last edited: Jul 15, 2017
Thread Status:
Not open for further replies.

Share This Page