I am currently working on a plugin that allows you to accept the identity of another player. It does this almost flawlessly: your UUID and username are changed to the username whose identity you accept on the server, and as far as possible to the server and plugins, you are such a player. You will have the same rank as theirs, the same permissions, that's all. The only thing I could not get is the skin. I thought the player’s skin would be changed for other players when the UUID was, but this does not seem to be the case. I use reflection to change the UUID in both GameProfile and EntityPlayer (the uniqueID field is inherited from Entity), and all methods to get the player’s UUID return the one that was set by the plugin. I dug the decompiled NMS and Bukkit / Spigot forums, but they all seem to indicate that the skin should change using the UUID.I am sending PlayerQuitEvent and PlayerJoinEvent for plugins to simulate the real player, the outgoing and the intended player, and send packets to all players to remove the old player from the tab and the game, and then add a new one. I would prefer not to use ProtocolLib if this can be avoided. Any help would be appreciated, can someone point me in the right direction?
Thanks in advance!
source
share