All commands
๐ŸŸข
UtilityJava โœ“Bedrock โœ“

/xp

Give or set experience points and levels for any player.

๐ŸชจBedrock note: Bedrock uses /xp <amount>[L] [player] - add L for levels, e.g. /xp 30L @s.

Overview

What is the /xp command?

The /xp command (also /experience) gives or removes experience points or levels. You can hand out levels for enchanting, drain a player's XP, or set an exact amount โ€” useful for balancing minigames and economies.

Note the difference between points and levels: 'add 100 points' and 'add 100 levels' are very different amounts.

When to use it: Use /xp to grant enchanting levels, reward players, or reset experience between rounds.

At a glance

Syntax

Syntax
/xp add <target> <amount> [points|levels]
commandtargetcoordsvaluerequiredoptional

See it

What it does

Level Up!
Experience flows in

Anatomy

Every part, explained

  1. 1
    /xp addCommandRequired

    Use 'add' to grant, 'set' to overwrite.

  2. 2
    <target>TargetRequired

    Who gets the XP. @s is yourself.

  3. 3
    <amount>AmountRequired

    How much to add or set.

  4. 4
    [points|levels]UnitOptional

    Choose points or levels. Defaults to points.

Your turn

Try it yourself

Playground
5 tokens ยท press Enter to run

Copy & paste

Examples

/xp add @s 30 levels

Enough to enchant in one go.

/xp add @s 100 points

A small top-up of raw XP.

/xp set @s 0 levels

Reset a player back to zero.

Avoid these

Common mistakes

โœ•/xp add @s 30
โœ“/xp add @s 30 levels

Without a unit it adds points - say 'levels' if you mean levels.

โœ•/xp add 30 levels @s
โœ“/xp add @s 30 levels

Order is target, then amount, then unit.

Good to know

Frequently asked questions

How do you give yourself XP levels?
Run /xp add @s 30 levels (or /experience add @s 30 levels) to gain 30 enchanting levels.
What is the difference between points and levels?
Levels are the green number on the XP bar; points are the raw experience. Higher levels need far more points each, so the two scales aren't equal.
How do you reset a player's XP?
Use /xp set @s 0 levels to wipe their levels back to zero.

Keep going

Related commands