Discussion in 'Plugin Development' started by LIMPIX31, Apr 17, 2021.
How to change skin and cloak using bukkit api or NMS(1.16)
You need to send a request to mojang's servers to get a skin texture and signature, then edit the player's gameprofile by inserting these values (clearing the old ones). You then need to hide and unhide the player for all other players for it show the updated skin.
You''ll have to use NMS or reflection to edit a player's gameprofile, however, ProtocolLib is a better option as you can use the WrapperGameProfile class and edit that. To get the skin data you need to send a request to
If you google around you can find some implementations of this.
Ok, can I set the player's skin (cloak) by getting my own image from the URL.
Most likely, this can also be done via ProtocolLib?
TBH, this is maybe one of the very, very few cases where I would choose NMS over an external library like ProtocolLib.
^ the GameProfile api hasn't changed in basically forever, and unlike most NMS code the package name doesn't include the server version.
Of course, if you're doing other stuff that requires NMS-y things (in which case you need ProtocolLib), then I'd recommend using ProtocolLib's wrapper for GameProfile.
You can only get skin data from a Minecraft account because you need a signed value which only mojang can create. To set a player's skin with an image URL you'd have to use something like MineSkin, but you'd have to do our own research on that.
Yeah either works.
How do I use mineskin in my plugin?
what about the cloak
The cape is tied with the skin texture value. If you change someone's skin they will get whatever cape that person has (assuming they have one)
I need to change the cape to my image via the URL
That's not possible as far as I know.
I think this is possible using modifications, Fabric for example
Which we don't support here as that requires a modded client.
Separate names with a comma.