Add, Set, or Query Player Experience
The /experience command lets you change or check how much experience a player has in Minecraft Java Edition. You can work with either full experience levels or individual experience points.
Players and server operators use this command to test mechanics, reward players on multiplayer servers, or check someone's current progress. You need permission level 2 (cheats enabled in single-player or operator status on a server) to run it.
/experience add <target> <amount>/experience add <target> <amount> levels/experience add <target> <amount> points/experience query <target> levels/experience query <target> points/experience set <target> <amount>/experience set <target> <amount> levels/experience set <target> <amount> points/experience add <target> <amount>/experience add <target> <amount> levels/experience add <target> <amount> points/experience query <target> levels/experience query <target> points/experience set <target> <amount>/experience set <target> <amount> levels/experience set <target> <amount> points| Argument | Type | What it means |
|---|---|---|
<target> | target selector players only | The player you want to affect, written as a player name, a UUID, or a target selector (players only) like @p, @a, @e, or @s. |
<amount> | whole number | A whole number, such as 5 or -3, indicating how much experience to add or set. |
/experience add @s 50Gives 50 experience to the player running the command.
/experience add @p 10 levelsGives 10 full experience levels to the nearest player.
/experience add @a 250 pointsGives 250 experience points to all players currently online.
/experience add Steve -3 levelsRemoves 3 experience levels from the player named Steve.
/experience set Alex 30 levelsSets the experience level of the player named Alex to exactly 30.
/experience set @e[type=player,limit=1] 0 pointsSets the experience points of a single targeted player entity to 0.
/experience query @s levelsChecks how many experience levels you currently have.
Measured from the game files of every Java release from 1.13 to 26.3.
+ /experience add <target> <amount>+ /experience add <target> <amount> levels+ /experience add <target> <amount> points+ /experience query <target> levels+ /experience query <target> points+ /experience set <target> <amount>− /experience add <targets> <amount>− /experience add <targets> <amount> levels− /experience add <targets> <amount> points− /experience query <targets> levels− /experience query <targets> points− /experience set <targets> <amount>and 4 moreIn Minecraft Bedrock Edition, players can use the shorter /xp command instead, which uses the syntax /xp <amount: int> [player: target] and puts the amount before the target player.
Use the /experience add command with a negative whole number, such as /experience add @p -5 levels.
You need permission level 2, which means cheats must be turned on in single-player or you must be an operator on a multiplayer server.
Yes, the command has been available since at least Java Edition 1.13, and in version 1.21.2 the syntax updated its argument formatting from <targets> to <target>.
/advancement/attribute/damage/defaultgamemode/effect/gamemode/kill/ride/rotate/spawnpoint/spectate/spreadplayers/summon/swing/teleport/tp