Offline mode UUID checking?

Discussion in 'Spigot Plugin Development' started by hihihih565, Apr 15, 2017.

  1. Is there a way to check if a UUID is an offline mode UUID?
     
  2. Try getServer().getOfflinePlayer() instead of Bukkit.getServer().getOfflinePlayer.

    If you're trying to do this outside if the main class you'll need to get the the instance of your plugin first.

    Like :
    YourPluginObject.getPlugin().getServer().getOfflinePlayer()


    Sent from my iPhone using Tapatalk
     
    • Friendly Friendly x 1
  3. I was more looking for a comparison, such as looping through a bunch of UUID's and if its an actual authenticated mojang UUID then continue, if not delete it. Just wondering if there was an easier way than using an api to check the UUID, but then I don't know if an offline mode UUID can be the same as someone elses online.
     
  4. That doesn't make a difference: both getServer() and Bukkit.getServer() return an org.bukkit.Server class instance.

    I think he wants to check if the server uses online (Mojang) UUIDs or offline (cracked) UUIDs.
    EDIT: Yes, I'm late but correct :)
     
  5. As a general rule of thumb, online mode UUIDs are all v4 UUIDs, and offline mode UUIDs are all v3 UUIDs. The way that you can distinguish between them is that all v4 uuids follow the format xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx, and all v3 UUIDs follow the format xxxxxxxx-xxxx-3xxx-xxxx-xxxxxxxxxxxx. (That bit in all cases designates the version of the UUID). So figuring it out is just a matter of checking that bit.