Levels and XP
How a player goes from XP to a claimed level, and every setting that shapes it.
Claiming a level
Levels are claimed, never granted automatically. XP only ever counts toward the one level the player is on.
- Earn XP. From the three sources below. The XP bar fills toward that level's cost.
- Meet the objectives. If the level has any, they must all be done too. See Objectives.
- It becomes ready. The level's tile in
/levelturns into the ready icon, and%alphalevels_ready%flips to true. - Claim and confirm. The player clicks the tile, or runs
/level claim. A confirmation menu opens with a green confirm button and a red cancel button. - Rewards run. The level-up message, title and sound play, and the reward commands run as the console.
The tile for every level shows one of four states, each with its own head icon:
| State | Meaning |
|---|---|
| Claimed | The player has already claimed it. |
| Ready | XP and objectives are done. Click to claim. |
| In progress | The one level the player is working on right now. |
| Locked | Every level after the current one. A level only unlocks when the one before it is claimed. |
The level curve
What each level costs is a formula in levels.yml:
max-level: 100
xp-curve:
base: 50
increment: 25
curve: 2.5
round-to: 5
required-xp(level) = base + increment × (level − 1) + curve × (level − 1)², rounded to the nearest round-to. Early levels come quickly, and later ones get steeply more expensive, so the cap is a long-term goal. With the defaults:
| Level | XP for that level | XP from level 1 up to and including it |
|---|---|---|
| 1 | 50 | 50 |
| 5 | 190 | 580 |
| 10 | 480 | 2,350 |
| 25 | 2,090 | 21,030 |
| 50 | 7,280 | 134,250 |
| 75 | 15,590 | 417,780 |
| 100 | 27,030 | 949,750 |
curve and increment to match the pace you want.XP sources
These live in config.yml under xp-sources, separate from the curve, so you can change how fast XP comes in without touching what levels cost.
xp-sources:
playtime:
enabled: true
interval-seconds: 60
xp-per-interval: 3
player-kill:
enabled: true
xp: 60
same-victim-cooldown-minutes: 20
allowed-worlds: [] # empty = every world
mob-kill:
enabled: true
hostile-xp: 4
passive-xp: 1
per-type:
ENDER_DRAGON: 1000
WITHER: 600
ELDER_GUARDIAN: 200
WARDEN: 800
ignore-spawner-mobs: true
ignore-npc-metadata: true
| Source | Default | Notes |
|---|---|---|
| Playtime | 3 XP every 60 s | The steady passive source. At the default, level 1 takes about 17 minutes of play. |
| Player kill | 60 XP | The biggest single burst. The same victim cannot be farmed again for same-victim-cooldown-minutes, which stops alt farming. allowed-worlds limits it to certain worlds. |
| Mob kill | 4 hostile, 1 passive | Any mob listed in per-type pays that amount instead. Mobs from spawners, and NPCs from plugins like Citizens, give nothing by default. |
Each source can be switched off with its own enabled, and the three feature flags xp-playtime, xp-player-kill and xp-mob-kill under features turn them off completely.
Objectives
A level can require more than XP. List them under objectives in levels.yml, keyed by level number. The level cannot be claimed until its XP is full and every objective is met.
objectives:
9:
player-kills: 3
30:
mob-kills:
DROWNED: 20
advancement: "minecraft:story/enter_the_nether"
50:
player-kills: 20
mob-kills:
PIGLIN_BRUTE: 10
advancement: "minecraft:nether/all_potions"
| Objective | Needs |
|---|---|
player-kills: N | N player kills made while on this level. |
mob-kills: {TYPE: N} | N kills of that entity type made while on this level. Use Bukkit entity names such as ZOMBIE or WITHER_SKELETON. |
advancement: "key" | That advancement is completed. This one is checked live and is lifetime, because an advancement cannot be un-earned. |
objectives only needs its XP. The shipped file has 24 objective levels, between level 3 and 100.Rewards
rewards:
base:
enabled: true
money-per-xp: 2
commands:
- "money give {player} {money}"
milestones:
10:
commands:
- "give {player} diamond 8"
- "give {player} experience_bottle 16"
baseruns on every claim.{money}is the level's required XP timesmoney-per-xp, rounded, so the payout grows with the cost. At the default, claiming level 10 pays 960 and level 100 pays 54,060.milestonesare hand-picked levels that run extra commands, normally items. The shipped file has 20 of them, from level 5 to level 100, ending in netherite blocks, totems and a nether star.- Every reward is a console command. The placeholders are
{player},{level},{xp_required}and{money}.
money give, which is CMI's syntax. If nothing on your server answers it, the money part of every claim does nothing, so replace it with your economy plugin's give-money command.Prestige
Claiming the last level (max-level, 100 by default) resets the player to level 1 and adds one to their prestige count. The prestige sound plays and the level-up event reports prestiged. There is no badge or cosmetic yet. The count is kept in the player's data and is available as %alphalevels_prestige%.
Developer event
Other plugins can react to every claim. net.alphastudio.alphalevels.event.PlayerLevelUpEvent is a normal Bukkit event fired whenever a player claims a level:
| Getter | Returns |
|---|---|
getPlayer() | The player who claimed. |
getPreviousLevel() | The level before the claim. |
getNewLevel() | The level after the claim. |
isPrestiged() | True when this claim was the maximum level and wrapped the player back to level 1. |
