Skip to content
Skip to content
Back to Blog
Minecraft player using XP command in chat to give experience to other players

The /xp Command: Give and Take Experience in Minecraft

Alexandru Maftei
Alexandru Maftei
@ice
Updated
26 views
TL;DR:The /xp command instantly gives or takes experience points and levels from any player in Minecraft. Learn the syntax, practical uses, and server admin tips for single-player, creative, and multiplayer gameplay.

The /xp command instantly gives experience points or levels to any player in Minecraft. It's essential for creative mode, testing enchantments, speedruns, and managing progression on multiplayer servers. Whether you're boosting a new player or resetting levels for an event, the syntax is straightforward once you learn it.

What This Command Does

The /xp command bypasses the normal grind entirely. Instead of hunting mobs for hours to reach a specific level, you can instantly award experience to yourself or other players. It works everywhere - creative mode, survival worlds, single-player, multiplayer servers, Realms, you name it.

I first started using it years ago to test enchanted gear without spending half the day leveling up. Now I can't imagine running my SMP or doing speedrun resets without it.

Basic Syntax and Structure

The core command is genuinely simple once you see it:

/xp add <player> <amount> [points|levels]

You're telling the game to "xp add" (give experience), then specify which player, how much, and what unit you're measuring. To give yourself 100 experience points right now, you'd type:

/xp add @s 100

The @s means self - it targets you, the player executing the command. Want to give someone else experience? Use their exact player name:

/xp add Steve 50 points

Need to give a whole group at once? That's what @a is for:

/xp add @a 20 levels

That command gives every single player on your server 20 levels instantly. Incredibly useful for events, contests, or when you want to reset everyone to the same starting point.

Points vs. Levels - Understanding the Difference

Here's where most people get tangled up, and I'll admit I had to test this carefully to be sure I had it right. Minecraft tracks experience in two separate ways simultaneously.

First, there's raw experience points - that's the green bar filling up on your screen. Then there's levels - the number displayed next to the bar. They're linked, but the relationship isn't simple or linear.

Early levels are cheap. You need about 7 points to gain your first level. By level 30, each level costs roughly 62 points. Keep climbing and the cost jumps exponentially. The math gets messy fast, honestly.

Which Unit Should You Use

When you use /xp add <player> 20 levels, the game converts that into the exact number of points needed for 20 levels at the player's current level. But if you use /xp add <player> 100 points with just points, you're adding raw points - that might only earn a fraction of a level depending where they're.

Levels are usually better for general play. They're intuitive and scale automatically. Look, if you want consistent rewards for an event, give levels.

Points are more precise for testing or building scoreboards.

Practical Commands You'll Use

Say you're setting up a speedrun race and everyone needs to start fair. Reset everyone to level 0:

/xp set @a 0 levels

Now give the group a starting level:

/xp add @a 30 levels

Everyone's at level 30. Equal footing.

Maybe you want to test an enchanted weapon. Give yourself some levels for enchanting:

/xp add @s 50 levels

You can also remove experience using negative numbers:

/xp add @s -25 points

That takes 25 points away. I've used this to gently penalize players exploiting mob farms without banning them - just a reset and a conversation.

Beyond "Add" - Other Command Modes

The command has a few other modes beyond just adding. "Set" places someone at an exact amount, ignoring whatever they had before:

/xp set @s 15 levels

Now you're at level 15, period.

There's also query mode for checking someone's current XP, but that's mostly admin work for scoreboards or debugging. The basics with "add" and "set" handle almost everything practical.

Server Administration and Fairness

On multiplayer servers, the /xp command becomes essential for balance. When a new player joins my small SMP mid-season, they're behind everyone grinding for weeks. A quick boost gets them in the game without feeling like charity.

During competitions or events, you can set everyone to the same level so nobody has an unfair advantage from grinding more experience beforehand. Everyone starts fresh.

Server administrators often pair /xp with command blocks and scoreboards to create custom progression systems. If you're interested in what other communities build, check out our Minecraft Server List for inspiration. For building progression-based structures, our block search tool helps you find materials that fit your theme.

Common Pitfalls and Pro Tips

Player names are case-sensitive. Typo the name and the command just fails silently - nothing happens, no error message.

This command requires operator permissions on servers. Regular vanilla survival doesn't allow it. If you want experience management on a public server, admins need to enable it through op settings.

The command gives experience directly to players - it doesn't create droppable XP bottles or items. That's just how it functions. Also, there's no visual effect or sound, so players might not notice they gained levels unless they're watching their bar.

Some servers add a tellraw message or particle effect alongside the command to make the reward obvious to players.

Creative Applications Beyond Basic Leveling

I've used /xp for way more than just basic leveling. Command blocks can trigger it automatically when players complete challenges in mini-games. Custom games reward winners with experience. You can tie it to scoreboards for fully automated progression systems.

The possibilities expand once you start combining it with other commands. Command chains, targeted selectors, scoreboards - there's real potential there if you want to build something complex.

Worth Using This Command

The /xp command solves real problems in your gameplay and server management. It's straightforward once you memorize the basic syntax, and it saves enormous amounts of time grinding when you're testing gear or running events.

Give it a try next time you're in creative mode or setting up an event. You'll wonder how you ever played without it.

About the author
Alexandru Maftei
Alexandru MafteiLead Writer

Lead writer at minecraft.how. Long-time Minecraft player running a small SMP server, testing every build, mod, and seed before writing about it.

Share with your friends!

Frequently Asked Questions

Can I use the /xp command in Survival mode?
Yes, but only if you're in Creative mode or have operator permissions. On multiplayer servers, only ops can execute the command. In single-player worlds, you can enable cheats and use it anytime. The command works identically across game modes once activated.
What's the difference between experience points and levels?
Experience points are the raw green bar value. Levels are the number displayed next to it. Early levels cost about 7 points, but later levels require exponentially more points - level 30 costs roughly 62 points per level. When using /xp with levels, the command automatically calculates the exact points needed.
Can I remove experience from a player?
Yes. Use negative numbers with the add command: /xp add <player> -50 points removes 50 points. You can go below level 1, though negative levels look unusual. It's useful for gently penalizing players without banning them, especially on multiplayer servers.
Does /xp set reset a player's levels completely?
Yes, /xp set places a player at exactly that amount, overwriting whatever they had. For example, /xp set @a 0 levels resets everyone to level 0. Use set for contests or when you want precise control; use add when you want to give a bonus on top of existing experience.
What's the fastest way to give everyone on my server the same level?
Use /xp set @a <level> levels. The @a selector targets all players. For example, /xp set @a 30 levels puts everyone at level 30 instantly. This is perfect for tournaments, events, or resetting progression before a new season starts.

Comments

No comments yet. Be the first to share your thoughts!

We use cookies to improve your experience. By continuing to use this site, you agree to our use of cookies. Read our Privacy Policy