Commands/experience

Adds, removes or queries player experience.
==Syntax==
* Java Edition
: experience add <targets> <amount> [levels|points]
: experience set <targets> <amount> [levels|points]
: experience query <targets> (levels|points)
: xp add <targets> <amount> [levels|points]
: xp set <targets> <amount> [levels|points]
: xp query <targets> (levels|points)
* Bedrock Edition
: xp <amount: int> [player: target]
: xp <amount: int>L [player: target]
==Arguments==
: (in add mode)
: Specifies the amount of experience points or levels to give to the player. Negative values remove experience instead of adding them.
: 
: (in set mode)
: Specifies the amount of experience points or levels to be set to the player.
: 
: 
: Specifies the amount of experience points or levels to be added to the player. This amount may represent either an amount of points or an amount of levels.
: If an L is added to the end, adds levels. Negative values remove experience instead of adding them.
: 
: If the amount is expressed in points, it must be between 0 and 2,147,483,647 (inclusive, without the commas).
: If the amount is expressed in levels, it must be between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas).
: (in add and set mode)
: 
: Specifies the target of the command. , if not specified, defaults to the command's executor.
: 
: (in query mode)
: Specifies the target of the command.
: 
==Result==
== Output ==
== Examples ==
* To display Steve's current level: experience query Steve levels
* To give 7 experience to yourself: xp 7 or experience add @s 7
* To give 3 levels to Alice: xp 3L Alice or xp add Alice 3 levels
* To remove all levels from all players: xp -2147483648L @a or xp set @a 0 or xp set @a 0 levels
== History ==
de:Befehl/experience
pt:Comandos/experience
ru:Команды консоли/experience
th:คำสั่ง/experience
uk:Команди консолі/experience
zh:命令/experience