Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement get xp for next level #260

Open
wants to merge 2 commits into
base: 1.20
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ public float getExperienceProgress() {
return entity.experienceProgress;
}

@LuaWhitelist
@LuaMethodDoc("player.get_xp_for_next_level")
public int getExperienceForNextLevel(){
checkEntity();
return entity.getXpNeededForNextLevel();
}

@LuaWhitelist
@LuaMethodDoc("player.get_experience_level")
public int getExperienceLevel() {
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/assets/figura/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,7 @@
"figura.docs.player.get_saturation": "Gets the current saturation level of the player",
"figura.docs.player.get_exhaustion": "Gets the current exhaustion level of the player",
"figura.docs.player.get_experience_progress": "Gets the progress of the way towards the player's next level, as a value from 0 to 1",
"player.get_xp_for_next_level": "Gets the amount of experience needed to level up",
"figura.docs.player.get_experience_level": "Gets the player's current level",
"figura.docs.player.get_model_type": "Returns \"SLIM\" or \"DEFAULT\", depending on the player's model type",
"figura.docs.player.get_gamemode": "Returns \"SURVIVAL\", \"CREATIVE\", \"ADVENTURE\", or \"SPECTATOR\" depending on the player's gamemode\nIf the gamemode is unknown, returns nil",
Expand Down
Loading