How to get a players name from his UUID

Discussion in 'Plugin Development' started by Minesuchtiiii, Oct 10, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Minesuchtiiii

    How can I get the name from a player when I only have his UUID?
    Need this for a sign ranking system for a game, I saved player's UUID in a MySQL database.

    Thanks.
     
  2. Offline

    Funergy

  3. Offline

    CaptainUniverse

    or if you want to do something simple Minesuchtiiii map the uuid to the players name. And when name change comes out, loop through the database and check if the players uuid doens't equal his name and then update it with the new one
     
  4. Offline

    Skionz

    You should save their UUID and their name too make it easier. It would also be easier to read.
     
  5. Offline

    CaptainUniverse

  6. Offline

    teej107

    CaptainUniverse Lol, I'm guessing he got ninja'd from looking at the post times.
     
    pookeythekid likes this.
  7. Offline

    pookeythekid

    Minesuchtiiii You are aware of the p.getName() method, right?
    Code:java
    1. Player p = Bukkit.getOfflinePlayer(uuid);
    2. instanceOfDataBase().howeverYouPutInfo(uuid, p.getName());

    As you can see, I have no experience with MySQL. xD
     
Thread Status:
Not open for further replies.

Share This Page