Player ID

Discussion in 'Plugin Development' started by paulharter, Jan 21, 2013.

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

    paulharter

    Hi

    I think I posted this in the wrong forum before. Help rather than plugins.

    I need a way to refer to a player reliably. It seems that Minecraft may be going to add the ability to change player names in the future, so name doesn't seem like a good idea. When a player logs in to Minecraft the login servers return a list of five colon separated values - see here:

    http://wiki.vg/Session

    The last of these seems to be a persistent id for the player.

    Is there any way to access this id for a player using Bukkit Player? getUniqueId() returns something different that seems to only be unique/persistent per server.

    Or is there another way to do this?

    Thanks

    Paul
     
  2. Offline

    paulharter

    bump!

    I'm still stuck with this. Any Ideas?

    Maybe I'll just use name for now and change it later when the ability to change names comes in.

    P
     
  3. Offline

    Lolmewn

    String username = player.getName();
     
  4. Offline

    Yukari

    I can't immediately find a bukkit method to do what you're looking for.

    Perhaps throw in a feature request?
     
  5. Offline

    caseif

    -.-
    You are using a Player variable, right?
     
  6. Offline

    Yukari

    I did look at Player variables, but I don't see any method to return the unique ID OP is looking for from a Player variable.
     
  7. When that name changing will be allowed then there should be another way to uniquely identify accounted players, because it will ruin the MC's ban system too. So don't worry about it...

    However, if you really want a solution, currently I belive you can use entity's UUID but I don't think it's persistent if player rejoins, only if player is in world after server restart.
    So you'll have to test it out: player.getUniqueId();
     
  8. Offline

    paulharter

    I tried this and, as you suggest, it only persists on a server between restarts.

    I will use player.getName() for now and put in a feature request as Yukari suggests

    Thank you all for your help

    Paul
     
  9. Offline

    WalterWeight

    So, with the announcement that 1.7.6 has been released today preparing for player name changing support, are there any plans for bukkit to introduce support for the unique player id anytime soon? I know this will affect the mod I've made, and I'm quite keen to fix it as soon as possible.
     
Thread Status:
Not open for further replies.

Share This Page