This Minecraft tutorial explains how to use the /xp command to increase your experience points with screenshots and step-by-step instructions.
If you want a quick way to gain experience points or even experience levels in the game, you can use the /xp command to add as much experience as you need (see also the /experience command). Let's explore how to use this cheat (game command).
Supported Platforms
The /xp command is available in the following versions of Minecraft:
Platform | Supported (Version*) |
---|---|
Java Edition (PC/Mac) | Yes (1.3.1) |
Pocket Edition (PE) | Yes (0.16.0) |
Xbox 360 | No |
Xbox One | Yes (1.2) |
PS3 | No |
PS4 | Yes (1.14.0) |
Wii U | No |
Nintendo Switch | Yes (1.5.0) |
Windows 10 Edition | Yes (0.16.0) |
Education Edition | Yes |
* The version that it was added or removed, if applicable.
NOTE: Pocket Edition (PE), Xbox One, PS4, Nintendo Switch, and Windows 10 Edition are now called Bedrock Edition. We will continue to show them individually for version history.
Requirements
To run game commands in Minecraft, you have to turn cheats on in your world.
Xp Command
- Java
- PE
- Xbox
- PS
- Nintendo
- Win10
- Edu
Xp Command in Minecraft Java Edition (PC/Mac)
In Minecraft Java Edition (PC/Mac) 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19 and 1.20, there are different syntaxes depending on whether you would like to add, query or set the experience of a player.
To add experience to a player:
/xp add <targets> <amount> [levels¦points]
To query the experience of a player:
/xp query <targets> <levels¦points>
To set the experience of a player:
/xp set <targets> <amount> [levels¦points]
In Minecraft Java Edition (PC/Mac) 1.8, 1.9, 1.10, 1.11 and 1.12, there are different syntaxes depending on how much experience you would like to add.
To add experience points to a player:
/xp <amount> [player]
To add experience levels to a player:
/xp <amount>L [player]
Definitions
- targets or player is the name of the player (or a target selector) that you wish to target.
- amount is the amount of experience. If you specify
levels
orL
after the amount (depending on your version of Minecraft), you will add experience levels. Otherwise, you will only add experience points. You can remove experience by entering a negative amount when adding experience to a player. - levels is used to indicate experience levels.
- points is used to indicate experience points.
Xp Command in Minecraft Pocket Edition (PE)
In Minecraft Pocket Edition (PE), there are different syntaxes depending on how much experience you would like to add.
To add experience points to a player:
/xp <amount> <player>
To add experience levels to a player:
/xp <amount>L <player>
Definitions
- amount is the amount of experience to add to the player. If you specify
L
after the amount, you will add experience levels. Otherwise, you will only add experience points. You can remove experience by entering a negative amount. - player is the name of the player (or a target selector) that you wish to give the experience to.
Xp Command in Minecraft Xbox One Edition
In Minecraft Xbox One Edition, there are different syntaxes depending on how much experience you would like to add.
To add experience points to a player:
/xp <amount> <player>
To add experience levels to a player:
/xp <amount>L <player>
Definitions
- amount is the amount of experience to add to the player. If you specify
L
after the amount, you will add experience levels. Otherwise, you will only add experience points. You can remove experience by entering a negative amount. - player is the name of the player (or a target selector) that you wish to give the experience to.
Xp Command in Minecraft PS4 Edition
In Minecraft PS4 Edition, there are different syntaxes depending on how much experience you would like to add.
To add experience points to a player:
/xp <amount> <player>
To add experience levels to a player:
/xp <amount>L <player>
Definitions
- amount is the amount of experience to add to the player. If you specify
L
after the amount, you will add experience levels. Otherwise, you will only add experience points. You can remove experience by entering a negative amount. - player is the name of the player (or a target selector) that you wish to give the experience to.
Xp Command in Minecraft Nintendo Switch Edition
In Minecraft Nintendo Switch Edition, there are different syntaxes depending on how much experience you would like to add.
To add experience points to a player:
/xp <amount> <player>
To add experience levels to a player:
/xp <amount>L <player>
Definitions
- amount is the amount of experience to add to the player. If you specify
L
after the amount, you will add experience levels. Otherwise, you will only add experience points. You can remove experience by entering a negative amount. - player is the name of the player (or a target selector) that you wish to give the experience to.
Xp Command in Minecraft Windows 10 Edition
In Minecraft Windows 10 Edition, there are different syntaxes depending on how much experience you would like to add.
To add experience points to a player:
/xp <amount> <player>
To add experience levels to a player:
/xp <amount>L <player>
Definitions
- amount is the amount of experience to add to the player. If you specify
L
after the amount, you will add experience levels. Otherwise, you will only add experience points. You can remove experience by entering a negative amount. - player is the name of the player (or a target selector) that you wish to give the experience to.
Xp Command in Minecraft Education Edition
In Minecraft Education Edition, there are different syntaxes depending on how much experience you would like to add.
To add experience points to a player:
/xp <amount> <player>
To add experience levels to a player:
/xp <amount>L <player>
Definitions
- amount is the amount of experience to add to the player. If you specify
L
after the amount, you will add experience levels. Otherwise, you will only add experience points. You can remove experience by entering a negative amount. - player is the name of the player (or a target selector) that you wish to give the experience to.
Examples
- Java
- PE
- Xbox
- PS
- Nintendo
- Win10
- Edu
Example in Java Edition (PC/Mac) 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19 and 1.20
To give 20 experience levels to the player called DigMinecraft in Minecraft 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19 and 1.20:
/xp add DigMinecraft 20 levels
To give 8 experience points to the nearest player:
/xp add @p 8 points
To remove 3 experience points from all players:
/xp add @a -3 points
To set the experience levels of a random player to 50:
/xp set @r 50 levels
To query the experience levels of the nearest player (you can only query one player at a time):
/xp query @p levels
Example in Java Edition (PC/Mac) 1.11 and 1.12
To give 3 experience points to the player called DigMinecraft in Minecraft 1.11 and 1.12:
/xp 3 DigMinecraft
To give 7 experience points to a random player:
/xp 7 @r
To give 5 experience levels to the player called DigMinecraft:
/xp 5L DigMinecraft
To give 12 experience levels to all players:
/xp 12L @a
To take away 3 experience levels from a random player:
/xp -3L @r
Example in Pocket Edition (PE)
To give 6 experience points to the player called Axe2Grind in Minecraft PE:
/xp 6 Axe2Grind
To give 25 experience levels to all players:
/xp 25L @a
To take away 2 experience levels from the nearest player:
/xp -2L @p
Example in Xbox One Edition
To give 5 experience points to the player called TheEarthMover in Minecraft Xbox One Edition:
/xp 5 TheEarthMover
To give 30 experience levels to all players:
/xp 30L @a
To take away 7 experience levels from a random player:
/xp -7L @r
Example in PS4 Edition
To give 3 experience points to the player called DigMinecraft in Minecraft PS4 Edition:
/xp 3 DigMinecraft
To give 25 experience levels to all players:
/xp 25L @a
To take away 2 experience levels from the nearest player:
/xp -2L @p
Example in Nintendo Switch Edition
To give 9 experience points to the player called DigMinecraft in Minecraft Nintendo Switch Edition:
/xp 9 DigMinecraft
To give 18 experience levels to all players:
/xp 18L @a
To take away 4 experience levels from all players:
/xp -4L @a
Example in Windows 10 Edition
To give 15 experience points to the player called TheExcavator in Minecraft Windows 10 Edition:
/xp 15 TheExcavator
To give 8 experience levels to the nearest player:
/xp 8L @p
To take away 5 experience points from a random player:
/xp -5 @r
Example in Education Edition
To give 4 experience points to the player called TheEarthMover in Minecraft Education Edition:
/xp 4 TheEarthMover
To give 30 experience levels to a random player:
/xp 30L @r
To take away 4 experience levels from all players:
/xp -4L @a
How to Enter the Command
1. Open the Chat Window
The easiest way to run a command in Minecraft is within the chat window. The game control to open the chat window depends on the version of Minecraft:
- For Java Edition (PC/Mac), press the T key to open the chat window.
- For Pocket Edition (PE), tap on the chat button at the top of the screen.
- For Xbox One, press the D-Pad (right) on the controller.
- For PS4, press the D-Pad (right) on the controller.
- For Nintendo Switch, press the right arrow button on the controller.
- For Windows 10 Edition, press the T key to open the chat window.
- For Education Edition, press the T key to open the chat window.
2. Type the Command
We will cover examples of how to use the /xp command to add experience points to a player as well as experience levels.
Add Experience Points
Let's start by showing how to add experience points to a player.
For example, you could add 3 experience points to the player called DigMinecraft with the following command:
/xp 3 DigMinecraft
Type the command in the chat window. As you are typing, you will see the command appear in the lower left corner of the game window. Press the Enter key to run the command.
Once the cheat has been entered, the experience points will be added to the player's experience bar.
You will see the message "Given 3 experience to DigMinecraft" appear in the lower left corner of the game window.
You have now given 3 experience points to the player called DigMinecraft.
Add Experience Levels
In the first example, we added experience points. Now let's show you how to add experience levels using the /xp command.
When you use the L
attribute with the /xp command, you add experience levels to a player. An experience level is one entire bar filled. When you add an experience level, you will see the experience level counter for the player increase.
For example, you could add 5 levels of experience to the player called DigMinecraft with the following command:
/xp 5L DigMinecraft
Type the command in the chat window and press the Enter key to run the command.
Before the /xp command is entered, the player is at experience level 2.
Once the cheat has been entered, you will see the message "Given 5 levels to DigMinecraft" appear in the lower left corner of the game window.
Now the experience counter for DigMinecraft has increased from 2 to 7 because you have given 5 experience levels to this player.
Congratulations, you just learned how to use the /xp command in Minecraft!