/xp add @p 10 levelsLevels affect the enchanting table. The XP bar shows progress within the current level.
The /xp command (alias /experience) manages player experience. Adding negative levels with add will subtract XP. The set action only accepts non-negative values.
The /xp command (alias of /experience) manages player experience. This generator lets you add, set, or query experience in both points and levels for any player or selector target.
The command has three operations: add (increase or decrease XP), set (overwrite to exact value), and query (read current XP). Each operation works with either points (the green bar progress) or levels (the number displayed above the bar).
XP matters for enchanting: the enchantment table requires levels 1 to 30 depending on the tier. It is also used in anvil repairs and renaming. Server admins and map makers use the /xp command to reward players, set up progression systems, or reset XP after events.
| Command | Effect |
|---|---|
| /xp add @s 30 levels | Gives 30 complete levels, enough for max-tier enchanting |
| /xp add @s 30 points | Gives 30 individual XP points, less than 3 full levels from zero |
| /xp set @s 0 levels | Resets the player's level count to zero |
| /xp add @s -5 levels | Subtracts 5 levels, useful for XP-as-currency systems |
| /xp query @s levels | Reports the player's current level without changing it |
Points vs levels: a "levels" amount adds whole levels, while a "points" amount adds raw XP units. Thirty points is less than three full levels from zero, so always check which unit you need before copying.
XP scaling is not linear. Each level requires more points than the last, following a tiered formula. Level 30 (the max enchanting level) needs 1,395 total points, level 7 needs 112, and level 50 costs 7,887.
| Level Range | Points Per Level | Cumulative at End |
|---|---|---|
| 0 to 16 | 2L + 7 (starts at 7, ends at 37) | 352 points at level 16 |
| 17 to 31 | 5L - 38 (starts at 42, ends at 112) | 1,507 points at level 31 |
| 32+ | 9L - 158 (starts at 130, scales steeply) | Level 50 costs 7,887 total |
The /xp command (alias for /experience) manages player experience. It can add XP points or levels, set XP to a specific value, or query a player's current XP. The command works with both points (the green bar) and levels (the number above the bar).
Reaching level 30 from level 0 requires 1,395 XP points. The XP curve scales non-linearly: levels 0-16 cost 2L+7 points each, levels 17-31 cost 5L-38 points each, and levels 32+ cost 9L-158 points each. So higher levels become progressively more expensive.
Add increases the player's current XP by the specified amount (can be negative to subtract). Set overwrites the player's XP to the exact value specified. Both can operate in points or levels units.
Yes. /xp is a shorter alias for /experience. They are functionally identical. Most players use /xp because it is faster to type.
Browse more Minecraft tools: