mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-16 23:55:14 +01:00
Added Player#getExp and Player#getLevel
This commit is contained in:
parent
4c93450520
commit
1261974420
@ -1152,6 +1152,15 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
playerConnection.sendPacket(updateHealthPacket);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the percentage displayed in the experience bar
|
||||
*
|
||||
* @return the exp percentage 0-1
|
||||
*/
|
||||
public float getExp() {
|
||||
return exp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to change the percentage experience bar
|
||||
* This cannot change the displayed level, see {@link #setLevel(int)}
|
||||
@ -1165,6 +1174,15 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
sendExperienceUpdatePacket();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the level of the player displayed in the experience bar
|
||||
*
|
||||
* @return the player level
|
||||
*/
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to change the level of the player
|
||||
* This cannot change the displayed percentage bar see {@link #setExp(float)}
|
||||
|
Loading…
Reference in New Issue
Block a user