Why doesn't the setLevel-method work?

Discussion in 'Plugin Development' started by jan1267, Jul 17, 2016.

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

    jan1267

    Hey
    iam new in plugin programming. In this event I just want to set my level on the value of "aktuellerLevel". All works and I checked the value of "aktuellerLevel" with consol output and it's all correct, but the Level will not be changed :( setLevel.PNG
     
  2. The problem is that this event is fired before the player respawns and thereby you cannot set the players level. What you need to do is schedule a bukkit runnable to run your code at least 1 tick later.

    Also, is there a reason that this EventHandler has priority high? There doesn't seem to be too much of a reason for it to me..
     
    jan1267 likes this.
  3. Offline

    jan1267

    Thank you :) it worked with a scheduler. Yes I don't know why I configurate the priority so high. At the beginning I think it doesn't matter which priority I choose :D
     
  4. Well, if you don't specify a priority it will do normal priority ;)
     
Thread Status:
Not open for further replies.

Share This Page