So I want to have a command that takes a user's name as an argument. Say /somecommand [User Name] Now I need to get the UUID of that user's name to store in SQL, but how do I go about that without using Bukkit's temporary "hack" that allows that to happen.
If the player's online when you're running /somecommand, then Bukkit.getPlayer(playerName) will work fine (currently marked as deprecated, but it's still a valid thing to do). Once you have the Player object, you can get the UUID very simply with player.getUniqueId(). If the player is offline, it's a bit harder. evilmidget38's UUIDFetcher class may be helpful, but you will need to run it async (which given you just want the UUID for SQL storage, hopefully won't be too much of a problem).
While slow, you can still use Bukkit.getOfflinePlayer(name), which will return null if they have never played before (might be more of a functionality you want).
I don't remember it returning null, but maybe I'm wrong. Edit: People use it for scoreboards all the time, it can't possibly return null. It has a "hasPlayedBefore" method or something like that, though, IIRC.
Garris0n https://github.com/Bukkit/CraftBukk...org/bukkit/craftbukkit/CraftServer.java#L1275 It won't return null for anything that isn't a valid username (a recent fix for OfflinePlayers and Scoreboards since you weren't able to properly get OfflinePlayers) for Scoreboards, and I believe it'll either return the OfflinePlayer with a valid UUID (Online mode) or an OfflinePlayer with an invalid one (Offline Mode)