get a players exp level when joining

Discussion in 'Plugin Development' started by ninjastar1011, Feb 28, 2013.

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

    ninjastar1011

    Hi :D its me again :p so i am trying to make a plugin that when your exp level is a certain level you get added abilities :) so i have this
    Code:
        public void onPlayerJoin (PlayerJoinEvent e){
            Player p = e.getPlayer();
           
            int level = p.getLevel();
           
            if(){
               
               
            }
           
        }
    haha sorry if its really bad code im still just learning :) thanks

    ps if its not very detailed, what i want is that when the player joins it detects its level and then ifit has a specific level like the player is level 50 then they can do something that someone that is level 20 cant :)
     
  2. Offline

    Tirelessly

    It really depends on what you want these abilities to do, but a good starting point would be "if(level==50)"
     
  3. Offline

    ninjastar1011

    Tirelessly
    ah ok thats the main thing i wanted to figure out :p but ill try and get some abilities and if im not sure ask here :D
     
  4. Offline

    leiger

    Hi ninjastar,

    You may wish to consider using the PlayerExpChangeEvent instead of only checking when the player joins. This way if they kill a mob and gain additional experience, you can give them their special abilities immediately rather than having to wait until they log back in again.
     
Thread Status:
Not open for further replies.

Share This Page