[SPIGOT-3553] Make SkullMeta methods use UUID instead of player name and add getter/setter for texture Created: 06/Sep/17  Updated: 07/Sep/17  Resolved: 06/Sep/17

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: vcdf Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None


 Description   

The SkullMeta class hasn't been updated for years and now has two flaws:

  • Getter and setter for the skull owner still use player name instead of UUID.
  • There is no way to access the texture of the skull.

This is the NBT tag of an example player head item (generated using this website):

{display:{Name:"Notch Head"},SkullOwner:{Id:"d220a6b0-d62b-4112-96d6-a1b1846d275a",Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTExNmU2OWE4NDVlMjI3ZjdjYTFmZGRlOGMzNTdjOGM4MjFlYmQ0YmE2MTkzODJlYTRhMWY4N2Q0YWU5NCJ9fX0="}]}}}

My suggestions:

1) Add a method boolean setOwner(UUID owner)

This method would change the SkullOwner's UUID.

2) Add a method UUID getOwner()

This method would return the SkullOwner's UUID.

3) Add a method boolean setTexture(String texture)

The method would put the texture parameter into the NBT tag's Value field and change the SkullOwner UUID to a new random one.

4) Add a method String getTexture()

This method would return the current texture of the player head.

5) Deprecate boolean setOwner(String owner) and String getOwner()

 

These changes would make player skulls namechange-proof and would allow modifying a skull's texture without the texture being used as skin by a Minecraft account.

Additionally, the Skull block state class could get methods similar to 3) and 4).

 



 Comments   
Comment by vcdf [ 07/Sep/17 ]

There is never a 100% guarantee, Mojang removes functionailty all the time. Mojang employees saying they won't remove it is as guaranteed as it can get.

Comment by md_5 [ 07/Sep/17 ]

I'm referring to when they stopped accepted skins that didn't have a valid and matching signature.
Building an API predicated on Mojang being generous enough to waste money storing deleted skins is a terrible idea. There is no "guarantee " here.

Comment by vcdf [ 06/Sep/17 ]

Dinnerbone has described the official way to create player heads with custom textures:
https://www.reddit.com/r/Minecraft/comments/32wwju/184_is_now_out/cqfpzbj/?context=3
What they blocked is skin urls from locations other than textures.minecraft.com

Right now, if we want our plugin to create a player head with a custom texture, we need to own a seperate Minecraft account for each texture and we can never change its skin because then heads created by the plugin would also use the new texture. With the new methods I proposed, we could temporarily upload the skin to an account, grab the base64 encoded texture url and the head would be guaranteed to never change its texture because Mojang stores all past skins forever (https://www.reddit.com/r/Minecraft/comments/2qkbsz/i_recently_discovered_that_you_can_make_unlimited/cn6wfm5/).

Comment by md_5 [ 06/Sep/17 ]

I do not think skin spoofing is something Mojang condones, and it is something they have blocked in the past (1.7.x)

Comment by vcdf [ 06/Sep/17 ]

The structure of the NBT tag hasn't changed since 1.8 (when custom textures were introduced).

Mob heads with custom textures are being used in many projects by the community (for example https://xisumavoid.com/moremobheads/), so I don't think Mojang is going to remove that functionality.

Comment by md_5 [ 06/Sep/17 ]

Theres another ticket about that, but I don't think its likely to be a stable api

Comment by vcdf [ 06/Sep/17 ]

Thanks for the fix @md_5
Any thoughts on a getter/setter for textures? I think this would be an appropriate addition since many developers would benefit from that functionality and the Bukkit API currently doesn't offer it.

Generated at Sat Dec 13 11:55:02 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.