XP Command Generator

Add, subtract, set, or query a player's experience and level

Bedrock only supports the add form. Use a negative number to subtract XP.

Use a negative value to subtract (add only)

How XP points differ from levels

Points are the green orbs you collect, while level is the green number above the bar. The higher your level, the more points it takes to reach the next one — so giving 30 levels is not the same as giving 30 points.

  1. Choose whether to add/subtract, set, or just check
  2. Specify the target and amount, then choose points or levels as the unit
  3. Copy the command and run it in Minecraft

On Bedrock the command looks like /xp <amount>[L] <player> — the trailing L means the unit is levels, and there is no set or query form

Worked examples

The examples below come out of the same generator as the form above, so the commands and explanations always match what the tool produces. Copy one and adjust it from there

1. Grant experience as levels

Levels and points behave very differently — pick the unit that matches what you actually want

/xp add @p 30 levels

What it does Will give the nearest player 30 more level(s).

2. Reset experience to zero

set overwrites the current value rather than adding to it — use it to wipe the slate at the start of a round

/xp set @a 0 levels

What it does Will set all players's level(s) to exactly 0.

3. Take experience points away

A negative amount subtracts — the basis of a "pay with XP" system

/xp add @s -100 points

What it does Will reduce themselves (whoever runs the command)'s experience point(s) by 100.

How this command differs by edition and version

This is the first example above, run through every edition and version this tool supports. Versions that produce the same result share a row

Java Edition 1.21.5 and up Java Edition 1.20.5 - 1.21.4 Java Edition 1.13 - 1.20.4 (legacy NBT)
/xp add @p 30 levels
Bedrock Edition (stable)
/xp 30L @p
  • Bedrock marks the unit as levels by appending L to the amount, so the command is generated in that form

Before you use these