Change players UUID

Discussion in 'Spigot Plugin Development' started by LetsHacks, Mar 10, 2019.

  1. Hello there!

    I want to change the UUID of a player for my nick system.
    You may ask why?
    - Labymod uses the player's uuid to keep the cosmetics of the player (wings, cape, etc.)
    -> So I need to change the players uuid for that.

    But how?!
    I didnt really find something neccesary out there!

    Thanks for your replies.

    Best regards,

    LetsHacks
     
  2. SteelPhoenix

    Moderator

    Under no circumstance should UUID be modified, as it will mess with the server and plugins
     
    • Agree Agree x 1
  3. You can't.
     
  4. You can't change a player's UUID. The UUID is stored in the database of Mojang. Every account has its own unique UUID.
     
  5. SteelPhoenix

    Moderator

    You can change the UUID in the GameProfile object, but this is only server sided.
     
  6. Yeah, i meant server side. How does it work with GameProfile?
     
  7. SteelPhoenix

    Moderator

    Use reflection to modify the field holding the uuid in the player's gameprofile
     
  8. You will also need to send destroy entity packets along with addplayer and spawn entity so if the player has different skins and such it will respawn / re render
     
  9. Could you post a code snippet?
    I would really appreciate it
     
  10. Do this at your own risk and don't post errors in review sections when plugins stop working.

    EDIT: Or contact the owner of the plugin your using to change what you want.
     
  11. Thanks for your advice, but all i need is a code to understand how to do it :)
     
  12. If you think someone will give you with the spoon, just don't. Learn basic reflection and use that to modify the values
     
  13. SteelPhoenix

    Moderator

    ^^ This is all you gotta do. If you don't understand you need to learn more Java. Copy pasting other code wont make you know what you're doing.
     
  14. Correct me if I’m wrong but I’m pretty sure LabyMod would still get their proper UUID and display all capes / cosmetics even if you change the UUID server sided
     
  15. Could be true. Do you have another idea how i could remove the players labymod cosmetics?
     
  16. I heared somewhere that LabyMod has an api that allow servers disabling cosmetics but you need to aks them for the api
     
  17. That's not true! Here you have a proof https://twitter.com/i/status/974621029086752768
     
  18. How did you do that?
     
  19. I changed the UUID in GameProfile and then updated the player. The only problem is that the player him self see only a steve or alex skin but the other players see the skin. I dont't if there is a way to fix that but I think it's not that bad.