Minecraft:Commands/xp
More actions
Template:Infobox command Adds, removes or queries player Minecraft:experience.
Syntax
- Java Edition
experience add <targets> <amount> [levels|points]xp add <targets> <amount> [levels|points]- Increases or decreases experience amount or experience level.
- If experience amount, it is counted into the player's Score.
- If experience level, it is not counted into the player's score. The amount of experience points in the current experience bar is scaled proportionally, keeping the progress of experience bar unchanged.
- Increases or decreases experience amount or experience level.
experience set <targets> <amount> [levels|points]xp set <targets> <amount> [levels|points]- Setting experience amount or experience level. Does not change the player's score.
- If setting experience amount, the experience level is not changed. If the specified amount is greater than or equal to the remaining capacity of a player's current experience bar, the setting does not work for the player.
- If setting experience level, the amount of experience points in the current experience bar is scaled proportionally, keeping the progress of experience bar unchanged.
- Setting experience amount or experience level. Does not change the player's score.
experience query <targets> (levels|points)xp query <targets> (levels|points)- Queries experience level or the experience amount in the current experience bar.
- Bedrock Edition
xp <amount: int> [player: target]- Increases experience amount.
xp <amount: int>L [player: target]- Increases or decreases experience level. The amount of experience points in the current experience bar is scaled proportionally, keeping the progress of experience bar unchanged.
Arguments
Template:El: Template:Argument (in add mode)
- Specifies the amount of experience points or levels to give to the player. Negative values remove experience instead of adding them.
- Template:Arg desc
Template:El: Template:Argument (in set mode)
- Specifies the amount of experience points or levels to be set to the player.
- Template:Arg desc
Template:El: Template:Argument
- 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
Lis added to the end, adds levels. Negative values remove experience instead of adding them. - Template:Arg desc If the amount is expressed in points, it must be not lower than 0.
Template:El: Template:Argument (in add and set mode)
Template:El: Template:Argument
- Specifies the target of the command. Template:IN, if not specified, defaults to the command's executor.
- Template:Arg desc
Template:El: Template:Argument (in query mode)
- Specifies the target of the command.
- Template:Arg desc
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table
Examples
- To display Steve's current level:
experience query Steve levelsTemplate:Only - To give 7 experience to yourself:
xp 7Template:Only orexperience add @s 7Template:Only - To give 3 levels to Alice:
xp 3L AliceTemplate:Only orxp add Alice 3 levelsTemplate:Only - To remove all levels from all players:
xp -2147483648L @aTemplate:Only orxp set @a 0Template:Only orxp set @a 0 levelsTemplate:Only
History
Java Edition
Bedrock Edition
External links
Minecraft:de:Befehl/experience Minecraft:es:Comandos/xp Minecraft:ja:コマンド/experience Minecraft:pt:Comandos/xp Minecraft:ru:Команды консоли/experience Minecraft:th:คำสั่ง/experience Minecraft:uk:Команди консолі/xp Minecraft:zh:命令/experience