Hey Guys I am currently working on a plugin and I was wondering how I could set the xp bar to half full.
22vortex22 There are multiple ways of doing this: Player#setLevel(...) Player#setTotalExperience(...) and finally Player#setExp(...)
Well, I looked it up and I can see that there are 17 EXP points in the first level. So, in order to set it to half you would want half of 17 which would be 8.5. So if you wanted to set a players XP bar to half you would do player.setExp(8.5);
Johnzeh doesn't work.. setExp uses a float since its a percentage Any solutions? EDIT by Moderator: merged posts, please use the edit button instead of double posting.