PlayerHeads

Discussion in 'Plugin Development' started by tbnralex, Mar 15, 2021.

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

    tbnralex

    i know how to link a player to the head is thier a way to spsicfcy what skin from the player to use i need a lot of player heads and i dont want to spend money on dusons of alts
     
  2. Offline

    Legendary_zotar

    Theres 3 ways that i know of to get skulls
    1. You can use SkullMeta (cast ItemMeta to SkullMeta) and use SkullMeta#setOwningPlayer. I think i remember reading a post about how this works, It grabs the data when you use .setOwningPlayer so it may pause the main thread? Not sure. Could try, but wouldn't recommend. (Also dont think it'd work if the player has never joined before since it uses OfflinePlayer)
    2. You can use other player heads and /give it to yourself. This method isn't very reliable since players may change they're skins. (For this method you can use websites like NameMC.com)
    3. You can get the actual texture and save its data by either:
      • A) Change your skin, get your own skull, save the item data (Something like Base64?) and use that when needed
      • B) Get the raw skin data and set the item's texture data to that (You can use websites like Minecraft-Heads.com). You can find the raw texture data under Other > Value (Image Attached)
    [​IMG]

    I'd say the quickest way is the 3rd way since you dont have to fetch data from online but im not sure how version safe it is. And 3B may require NMS or Reflection.
     
Thread Status:
Not open for further replies.

Share This Page