Run Experience Commands with the /xp Alias
/xp is an alias of /experience: it accepts the same arguments and does the same thing.
The /xp command is a built-in shortcut in Minecraft Java Edition. It acts as an exact alias for the /experience command, doing the exact same thing with less typing.
Players and server operators use this command when they want to manage player experience quickly. Because it requires permission level 2, you must be an operator on a server or have cheats enabled in your single-player world to run it.
/xp → experience …/xp → experience …/xp add @s 50 pointsAdds 50 experience points directly to the player typing the command.
/xp add @p 5 levelsGives 5 full experience levels to the nearest player.
/xp set @a 0 levelsResets the experience levels of every player on the server back to zero.
/xp set @r 100 pointsSets the experience points of one random player to exactly 100.
/xp query Steve levelsChecks how many total experience levels the player named Steve currently has.
/xp query Alex pointsChecks the current experience points progress for the player named Alex.
Measured from the game files of every Java release from 1.13 to 26.3.
Bedrock Edition also includes the /xp command, but it uses a different syntax form: /xp <amount: int> [player: target].
There is no difference in how they work; /xp is an alias that does the exact same thing as /experience.
You need permission level 2, which means you must be a server operator or have cheats enabled in a single-player world.
It has been available in every version measured from 1.13 all the way up to the newest version, 26.3.
/advancement/attribute/damage/defaultgamemode/effect/experience/gamemode/kill/ride/rotate/spawnpoint/spectate/spreadplayers/summon/swing/teleport