Minecraft /xp Command: Levels and Points on Any Edition
On Java, type /xp add @s 30 levels; on Bedrock, /xp 30L @s. Points vs levels, the /experience set and query forms, what it's useful for, and mistakes.
/xp gives or takes experience. On Java the full form is /xp add @s 30 levels, and /experience is the same command. On Bedrock it’s shorter: /xp 30L @s for levels, or /xp 100 @s for points. Cheats must be on.
/xp syntax
Java Edition (/xp and /experience are interchangeable)
/xp add <targets> <amount> [points|levels]
/xp set <targets> <amount> [points|levels]
/xp query <targets> <points|levels>
Bedrock Edition
/xp <amount> [player]
/xp <amount>L [player]
On Java, points is the default unit. On Bedrock, a number on its own is points and adding L makes it levels.
/xp examples
| Goal | Java | Bedrock |
|---|---|---|
| Add 30 levels | /xp add @s 30 levels |
/xp 30L @s |
| Add 500 points | /xp add @s 500 |
/xp 500 @s |
| Remove 5 levels | /xp add @s -5 levels |
/xp -5L @s |
| Reset to 0 | /xp set @s 0 levels |
/xp -100000L @s |
| Check levels | /xp query @s levels |
not available |
| Give everyone 10 levels | /xp add @a 10 levels |
/xp 10L @a |
Bedrock has no set or query, so taking away more levels than the player has is the usual way to zero someone out.
Points vs levels
Levels get more expensive as you go. Going from level 0 to 1 takes 7 points, while level 30 to 31 takes over 100. That’s why /xp add @s 1000 gets you to about level 26, not level 1,000. When you want a specific number on the bar, use levels.
On Java, /xp set with points can’t push past the current level’s bar. Set levels first, then points.
What you’ll use it for
- Testing an enchanting table. 30 levels and 15 bookshelves unlock the top offers.
- Anvil work. Combining books on an anvil eats levels quickly.
- Map rewards. Command blocks handing out XP for completing a challenge.
- Mending tests. Dropped points repair Mending gear; levels added by command don’t, since only orbs repair.
If you just want the enchantments, the /enchant command skips XP entirely.
Common mistakes
- Forgetting
levelson Java./xp add @s 30gives 30 points, not 30 levels. - Using Java syntax on Bedrock.
/xp adddoesn’t exist there. - Putting the
Lbefore the number. It’s30L, notL30.
More commands are on the commands hub.
Common questions
How do you give yourself 30 levels?
Java: /xp add @s 30 levels. Bedrock: /xp 30L @s. Thirty levels is what you need for the best enchanting table offers.
How do you remove levels with a command?
Java: /xp add @s -10 levels, or /xp set @s 0 levels to reset. Bedrock: /xp -10L @s.
What is the difference between points and levels?
Points are the raw experience orbs you collect; levels are the number above your hotbar. Higher levels need more points each, so 100 points is a lot at level 1 and very little at level 30.
Sources & verification
Facts on this page are checked against these references and in-game behavior for the stated edition(s). how we verify.
Keep reading