/xp
Give or set experience points and levels for any player.
Overview
What is the /xp command?
The /xp command (also /experience) gives or removes experience points or levels. You can hand out levels for enchanting, drain a player's XP, or set an exact amount โ useful for balancing minigames and economies.
Note the difference between points and levels: 'add 100 points' and 'add 100 levels' are very different amounts.
When to use it: Use /xp to grant enchanting levels, reward players, or reset experience between rounds.
At a glance
Syntax
/xp add <target> <amount> [points|levels]See it
What it does
Anatomy
Every part, explained
- 1
CommandRequired/xp addUse 'add' to grant, 'set' to overwrite.
- 2
TargetRequired<target>Who gets the XP. @s is yourself.
- 3
AmountRequired<amount>How much to add or set.
- 4
UnitOptional[points|levels]Choose points or levels. Defaults to points.
Your turn
Try it yourself
Copy & paste
Examples
/xp add @s 30 levelsEnough to enchant in one go.
/xp add @s 100 pointsA small top-up of raw XP.
/xp set @s 0 levelsReset a player back to zero.
Avoid these
Common mistakes
/xp add @s 30/xp add @s 30 levelsWithout a unit it adds points - say 'levels' if you mean levels.
/xp add 30 levels @s/xp add @s 30 levelsOrder is target, then amount, then unit.
Good to know
Frequently asked questions
- How do you give yourself XP levels?
- Run /xp add @s 30 levels (or /experience add @s 30 levels) to gain 30 enchanting levels.
- What is the difference between points and levels?
- Levels are the green number on the XP bar; points are the raw experience. Higher levels need far more points each, so the two scales aren't equal.
- How do you reset a player's XP?
- Use /xp set @s 0 levels to wipe their levels back to zero.
Keep going