Add or Remove Player Experience in Bedrock
The /xp command in Minecraft Bedrock Edition lets you add or remove player experience. It requires cheats to be enabled and a Game Directors permission level to run.
Players and server administrators use this command to quickly grant experience for testing, reward players in custom maps, or deduct experience as a penalty.
/xp <amount: int> [player: target]Add XP
/xp <amount: int> [player: target]Remove XP
| Argument | Type | What it means |
|---|---|---|
amount | int | An `integer` of the experience to add to the player. May only be negative to remove xp. |
player | target | A player name `string` or `target selector` to identify the player who should receive or lose xp. |
/xp 50Adds 50 experience to the player running the command.
/xp 100 SteveGives 100 experience directly to the player named Steve.
/xp 500 @aGrants 500 experience to every player currently online.
/xp 250 @pAdds 250 experience to the nearest player.
/xp 1000 @rRewards a randomly selected player with 1000 experience.
/xp -30 @sRemoves 30 experience from the player executing the command.
/xp -200 AlexTakes away 200 experience from the player named Alex.
In Minecraft Java Edition, the equivalent command is /experience, which uses subcommands like /experience add <target> <amount> [points|levels] and /experience query <target> levels, and places the target selector before the amount.
You can remove experience by typing a negative integer for the amount argument, such as /xp -50 @p.
The /xp command requires cheats to be enabled in your world settings and your account must have the Game Directors permission level.
Yes, you can use a target selector like @a in the player argument spot to add or remove experience for all players at once.
/aimassist/camera/camerashake/clearspawnpoint/controlscheme/damage/effect/event/gamemode/hud/inputpermission/kill/ride/spawnpoint/spreadplayers/summon