Skip to main content

/experience

Adds, sets, or queries experience points or levels for one or more players. Identical to /xp.

Category
Player
Permission Level
Game Master
Version Added
1.13

Overview

Adds, sets, or queries experience points or levels for one or more players. Identical to /xp. In vanilla Minecraft Java Edition it is one of the player commands and has been available since version 1.13.

It is invoked as /experience [levels|points] and accepts 3 required arguments (, , and ) and one optional argument ([unit]).

/experience is an alias — /xp behaves identically, so you can use whichever you prefer.

Introduced in 1.13 as the expanded version of /xp. Both commands remain available and behave identically.

The query action returns either the level count or the points within the current level, depending on the unit you ask for.

Syntax & Arguments

/experience <add|set|query> <targets> <amount> [levels|points]

The full syntax is /experience [levels|points]. Angle brackets < > mark required arguments and square brackets [ ] mark optional ones; a vertical bar | between words means you pick exactly one of those literals. You must always supply , , and . The argument [unit] may be omitted, in which case the documented default applies.

action
Required, of type a literal. The action to perform: add, set, or query.
targets
Required, of type an entity. The player(s) to modify.
amount
Required, of type an integer. The amount of experience. Omitted when action is query.
unit
Optional, of type a literal. Whether the amount refers to levels or points. Defaults to points.

Parameters

NameTypeRequiredDescription
actionliteralRequiredThe action to perform: add, set, or query.
targetsentityRequiredThe player(s) to modify.
amountintegerRequiredThe amount of experience. Omitted when action is query.
unitliteralOptionalWhether the amount refers to levels or points. Defaults to points.

Examples

The 3 examples below are ready to copy and adapt. For instance, /experience add @s 10 levels adds 10 experience levels to yourself. Each example varies the arguments to show a different real use of /experience; read the note under every snippet to see exactly what changes.

/experience add @s 10 levels

Adds 10 experience levels to yourself.

/experience set @p 0 levels

Resets the nearest player's level to 0.

/experience query @s points

Displays your current experience points within the current level.

Permission Level & Requirements

/experience sits at permission Level 2 - Game Master / Cheats, which means it needs permission level 2, the level cheats grant to single-player worlds and that operators hold by default.

In a single-player world you must have "Allow Cheats" turned on (or open the world to LAN with cheats) before it will run; on a multiplayer server the player needs to be an operator at the matching level.

This reference describes the Java Edition 1.21 form of the command; Bedrock Edition may use slightly different argument formats.

Common Mistakes

Notes

Introduced in 1.13 as the expanded version of /xp. Both commands remain available and behave identically.

Related Commands

If /experience is part of your toolkit, the commands below are the ones you will most often reach for alongside it: /xp and /enchant. They cover closely related tasks, so the links above jump straight to each one.

Frequently Asked Questions about /experience

What does the /experience command do in Minecraft?

Adds, sets, or queries experience points or levels for one or more players. Identical to /xp. It belongs to the player command group and was added in Java Edition 1.13.

What is the correct syntax for /experience?

/experience [levels|points]. The required arguments are action, targets, and amount, and the optional one is unit.

What permission level does /experience need?

It requires permission Level 2 - Game Master / Cheats. On a server the player must be an operator at that level, or have cheats enabled in single-player.

What is a common mistake when using /experience?

Trying to set points to a value higher than the current level's maximum, the command will fail.

Can you give an example of /experience in use?

Yes. /experience set @p 0 levels — resets the nearest player's level to 0.

Need a Minecraft server?

Try these commands on Astroworld or host your own server.

Try Astroworld Hosting