SHARE
TWEET

Untitled

a guest Aug 12th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Override
  2.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  3.         Player player = (Player) sender;
  4.  
  5.         if (cmd.getName().equalsIgnoreCase("UUID")) {
  6.             try(Connection c = null; Statement statement = c.createStatement();){
  7.                 ResultSet result = statement.executeQuery("SELECT * FROM users WHERE player_UUID = '"+ ((Player) sender).getUniqueId().toString() + "'");
  8.                 result.next();
  9.                 sender.sendMessage(ChatColor.RED + "Your UUID is: " + result.getString("player_UUID"));
  10.             }catch(Exception exception){
  11.                 exception.printStackTrace();
  12.             }
  13.         }
  14.         return true;
  15.     }
RAW Paste Data
Top