Commands/experience

Adds or removes player experience.

Syntax

 * Java Edition


 * Bedrock Edition

Arguments
(BE: amount: int)
 * Specifies the amount of experience to give to the player. This amount may represent either an amount of points or an amount of levels.


 * If an  is added to the end, adds levels instead.
 * 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).
 * If the amount is expressed in levels, it must be between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas).


 * For  and , it must be between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas).
 * For  and , it must be between 0 and 2,147,483,647 (inclusive, without the commas).
 * For  and , it must be between 0 and 2,147,483,647 (inclusive, without the commas).


 * Negative values remove experience instead of adding them.

(BE: player: target)
 * Specifies the target of the command. If not specified, defaults to the command's executor. Not optional in command blocks.

Result
Fails if arguments are not specified correctly, or if player fails to resolve to one or more online players.

On success, adds/removes experience or adds/removes levels. Total experience and levels are not reduced below 0.

Examples

 * To display Steve's current level:
 * To give 7 experience to yourself:  or
 * To give 3 levels to Alice:  or
 * To remove all levels from all players:  or   or

History
Befehl/experience Команды консоли/experience Команди консолі/experience 命令/experience