[SPIGOT-5947] Add Player Profile API Created: 05/Jul/20 Updated: 03/Feb/22 |
|
| Status: | Open |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor |
| Reporter: | Ivan | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | 1.16.1 | ||
| Version: | irrelevant |
| Guidelines Read: | Yes |
| Description |
|
Adding an API to modify player profile properties. |
| Comments |
| Comment by blablubbabc [ 03/Feb/22 ] |
|
A profile API for custom player head items/blocks has now been added: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/04c7e13cf0fb199cce3db3ada646b4bd61a57580 However, modifying the profile (e.g. skin) of a player entity is not yet possible. |
| Comment by Brokkonaut [ 13/Aug/20 ] |
|
A player profile api could also be very useful to create custom player heads (that do not use a real players uuid/name, but only a textue stored on mojangs skin servers) or to create a head from a stored player profile to avoid mojang lookups. |
| Comment by Foxxite [ 13/Aug/20 ] |
|
Isn't that hard to do yourself. I actually made a plugin out of it (https://www.spigotmc.org/resources/beta-multi-character.78441/) (Feel free to remove comment for shameless selfplug) |
| Comment by Ivan [ 03/Aug/20 ] |
|
reregistering the player works, remove player and then add player with a respawn packet if im not mistaken. |
| Comment by James Peters [ 22/Jul/20 ] |
|
I've been looking at how setting a skin would be achieved with NMS code so that this could be implemented in the API. I've tried setting the player's skin URL to another in the GameProfile PropertyMap and then sending a PlayerInfo packet.
getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, getHandle()));
But haven't seen much success, it doesn't seem to change the skin if the player already has it cached on their client? |
| Comment by Ivan [ 07/Jul/20 ] |
|
I don't want to sign the CLA, mainly cuz I don't want to dox myself. |
| Comment by Parker Hawke [ 07/Jul/20 ] |
|
Sure. I don't see why that can't be proposed at least as a PR. Though that String argument will have to be documented thoroughly much like we've done with resource packs (see Player#setResourcePack()) |
| Comment by Ivan [ 07/Jul/20 ] |
|
Sure, then we add Player#setSkin ?? |
| Comment by Parker Hawke [ 06/Jul/20 ] |
|
Then instead API for changing a player's skin should be added but wrapping the player profile in an API seems unnecessary to me. There should be a proper layer of abstraction around this rather than just letting developers access the profile and potentially break something they should not be. Even a Player#setSkin(String) or Player#broadcastSkinChange(String) would be more appropriate here. |
| Comment by Ivan [ 06/Jul/20 ] |
|
I can't agree with you Choco. What if I am making a minigame and want to change the skin of the player? |
| Comment by Parker Hawke [ 05/Jul/20 ] |
|
This isn't necessarily something we want to expose. Unless, of course, md_5 believes otherwise - though as far as I'm concerned this is an implementation detail that plugins should not be capable of modifying. |