First Join

Discussion in 'Plugin Development' started by stamline, Apr 27, 2014.

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

    stamline

    How can I check if the player joined for the first time in "PlayerJoinEvent"?
     
  2. if(event.getPlayer().hasPlayedBefore()) {
    //whatever

    returns false if it is their first time.
     
  3. Offline

    stamline

    oh.... Thanks
     
  4. Hehe, no problem. Anyone could have made that mistake. Happy coding :D
     
  5. Offline

    MrInspector

    There's supposed to be a ! :p
    Code:java
    1. if(!event.getPlayer().hasPlayedBefore()) {
    2. // code
     
  6. Either way, if you put an !, it'll return true if they've never played before. If you don't it'll return false. You've just reversed the outcome. (So we're technically both correct)
     
  7. Offline

    Mycrowut

Thread Status:
Not open for further replies.

Share This Page