Minecraft Java · 1.16+
/xp
Add, set and query experience in levels or points.
Levels and points
Points fill the progress bar. Levels are whole experience levels.
Remove experience
Choose Add or remove and enter a negative amount.
Query experience
Query one player for their level or current progress points.
FAQ Frequently asked questions 30 questions
Essential questions 5
What is /xp used for?
It adds, removes, sets and queries player experience in Minecraft Java Edition.
How do I give myself five experience levels?
Use /xp add @s 5 levels. The command increases the selected player's level by five.
How do I give one hundred experience points?
Run /xp add @s 100 points. The points change player experience and may increase the level.
How do I check my experience level?
Run /xp query @s levels as a player. The command returns the player's current level.
How do points differ from experience levels?
Levels are experience stages, while points fill the experience bar. Higher levels require different point amounts.
Syntax and arguments 5
What is the syntax for adding experience?
Use /xp add <targets> <amount> [levels|points]. A negative amount can decrease experience.
What is the syntax for setting experience?
Use /xp set <targets> <amount> [levels|points]. The assigned amount must be non-negative.
How do I query a player's experience?
Use /xp query <player> levels or /xp query <player> points depending on the desired measurement.
What is the default when no unit is specified?
The add and set branches default to points. The query branch requires an explicit unit.
How is add different from set?
The add branch adjusts existing experience by an amount, while set assigns an exact value.
Practical examples 5
How do I give Steve ten experience levels?
Run /xp add Steve 10 levels. Steve's experience level increases by ten when the command succeeds.
How do I remove three levels from Steve?
Use /xp add Steve -3 levels. The negative amount decreases the current level within valid limits.
How do I set the level to twenty?
Run /xp set @s 20 levels. This sets the selected player's experience level to twenty.
How do I set the experience level to zero?
Use /xp set @s 0 levels. Inspect the current experience bar points separately if needed.
How do I check my current bar points?
Run /xp query @s points. This reads points in the current bar rather than lifetime total experience.
Advanced usage 5
Can I give experience to every player?
Yes. For example, /xp add @a 5 levels modifies the experience levels of all matching players.
Can I remove experience points rather than levels?
Yes. The add branch accepts negative values that decrease experience within allowed limits.
Can the experience bar be used as an indicator?
Yes, but ordinary experience gains also change the bar and can interfere with the display.
Can I capture experience using /execute store?
Yes. The query branch returns a numeric value that a suitable /execute store mechanism can capture.
What happens to bar progress when levels change?
Changing levels can preserve proportional bar progress. Levels and points are not the same measurement.
Troubleshooting 4
Why does the old /xp 5L syntax fail?
That form belongs to Bedrock or older guides. Java 1.21.11 uses /xp add @s 5 levels instead.
Why does query fail to find a player?
Check the username and player availability. The query operation requires one suitable target.
Why does set points reject a value?
The assigned points are limited by the capacity of the current level. Use add for larger experience increases.
Why do one hundred points not grant one hundred levels?
The number of points required per level changes. Experience points and levels are not interchangeable.
Minecraft versions 3
When was the modern /xp syntax introduced?
Java Edition 1.13 introduced the add, set and query branches used by modern versions.
How is /xp different from /experience?
In modern Java Edition, /xp is an alias of /experience and accepts the same main arguments.
Are the Java and Bedrock commands identical?
No. Bedrock has its own argument order and L level suffix, while Java uses add, set and query.
Permissions and safety 3
What permissions are required for /xp?
Java Edition normally requires permission level 2. Mass experience changes should be controlled by server staff.
Can I accidentally remove valuable experience?
Yes. Negative add amounts and lower values assigned through set can reduce a player's experience.
How do I safely test experience changes?
Record the original levels and points, test the change on a separate player and only then apply it to the server.
Rate this tool
Did this tool work for you? Tell us what went well or what could improve.
Sign in to leave a review