The /experience or /xp command in Minecraft lets you add, delete or view a player’s experience. It’s a powerful tool that can be used to manipulate a player’s experience points or levels, and this Minecraft command is available in different versions of Minecraft, including Java Edition and Bedrock Edition.
Table of Contents
/experience command syntax
The syntax of the /experience
command varies depending on whether you want to add, set or query a player’s experience. Here are the main forms of the command:
- To add experience :
/experience add <targets> <amount> [levels|points]
- To set experience :
/experience set <targets> <amount> [levels|points]
- To query the experience :
/experience query <targets> (levels|points)
How to enter the /experience command
- Open the chat window : The key to open the chat window depends on the version of Minecraft you’re using (for example, the T key for Java Edition).
- Type command : Enter the appropriate command depending on what you want to do (add, set or query experience).
- Press Enter : Press Enter to execute the command.
Examples of use
- To give 20 levels of experience to the player called keither :
/xp add keither 20 levels
- To remove 3 experience points from all players :
/xp add @a -3 points
- To set a random player’s experience levels to 50 :
/xp set @r 50 levels
Explanations on arguments
<targets>
: Command target, can be a player name, a target selector or a UUID.<amount>
: Amount of experience points or levels to give, set or query. Negative values remove experience.[levels|points]
: Specifies whether the quantity is in levels or experience points.
Differences between /xp and /experience
The /xp
and /experience
commands are used to manipulate player experience in Minecraft, but there are a few key differences between them:
- Alias : The
/xp
command is an alias of the/experience
command. This means that in some versions of Minecraft, you can use these commands interchangeably. For example,/xp add <player> 10 levels
is identical to/experience add <player> 10 levels
. - Syntax : Although both commands perform similar functions, the syntax may vary slightly between Minecraft versions. In some versions, the
/experience
command offers more options and flexibility, such as the ability to set or query a player’s experience. - Supported version : The
/experience
command is generally supported in more recent versions of Minecraft, while the/xp
command can be used in older versions. However, in versions where both are supported, they work in a similar way. - Usage : The
/xp
command is often used to add experience points or experience levels to a player, while the/experience
command can also be used to set or query a player’s experience.
Additional information
- Supported versions : The command is available in various versions, including Java Edition (from 1.3.1) and Bedrock Edition.
- Using the L attribute : The L attribute can be used with the
/xp
command to add experience levels to a player, filling an entire experience bar. - Requirements : To execute game commands in Minecraft, you need to enable cheats in your world.
The /experience
command is a versatile tool that offers players and server administrators great flexibility in managing experience in Minecraft. Whether you want to reward a player with extra points or reset a player’s experience to a specific level, this command gives you the means to do so.