Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by hihihih565, Apr 15, 2017.
Is there a way to check if a UUID is an offline mode UUID?
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.
Sent from my iPhone using Tapatalk
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.
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
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.