[Question] Getting Players UUID From Their Name

Discussion in 'Plugin Development' started by Epicballzy, Jun 30, 2014.

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

    Epicballzy

    Is it possible for you to get the players UUID from a config by typing their name?


    The name would be the argument equal to the players UUID. So in the config, it will find the users UUID and add the "100 coins" to the total.

    If this is possible, could you give an example?

    The UUID's wouldn't be a problem if I would just use names, but I want to prepare for the name changing.
     
  2. Offline

    ko47374737

    It is possible let me get on my laptop and I'll give you an example code
     
  3. Offline

    Epicballzy

  4. Offline

    ko47374737

    Epicballzy Ok so you know how you can get a players uuid by p.getUniqueUUID();
    Well we are going to create a vable Player and do that so heres the code
    Code:java
    1. @SuppressWarnings("deprecation")
    2. Player target = Bukkit.getPlayer(args[1]);
    3. UUID u = target.getUniqueId();
     
  5. Offline

    thecrystalflame

  6. Offline

    ko47374737

    thecrystalflame You get better explanation most of the time on here rather then googling it
     
  7. Offline

    thecrystalflame

    notice how that google search leads you directly to this forum? to one of the other hundreds of posts answering this exact same question?
     
  8. Offline

    ko47374737

Thread Status:
Not open for further replies.

Share This Page