AlphaLevelsDocs v2.0.0
AlphaLevelsGuidesLevels and XP

Levels and XP

How a player goes from XP to a claimed level, and every setting that shapes it.

On this page

Claiming a level

Levels are claimed, never granted automatically. XP only ever counts toward the one level the player is on.

  1. Earn XP. From the three sources below. The XP bar fills toward that level's cost.
  2. Meet the objectives. If the level has any, they must all be done too. See Objectives.
  3. It becomes ready. The level's tile in /level turns into the ready icon, and %alphalevels_ready% flips to true.
  4. 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.
  5. 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:

StateMeaning
ClaimedThe player has already claimed it.
ReadyXP and objectives are done. Click to claim.
In progressThe one level the player is working on right now.
LockedEvery 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:

LevelXP for that levelXP from level 1 up to and including it
15050
5190580
104802,350
252,09021,030
507,280134,250
7515,590417,780
10027,030949,750
The defaults are a deliberate long grind. Watch how real players progress for a while, then raise or lower 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
SourceDefaultNotes
Playtime3 XP every 60 sThe steady passive source. At the default, level 1 takes about 17 minutes of play.
Player kill60 XPThe 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 kill4 hostile, 1 passiveAny 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"
ObjectiveNeeds
player-kills: NN 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.
Kill counts restart on every level. The counters reset the moment the player claims a level and moves on, so a kill never counts toward a level's quest before the player has reached it. A level with no entry under 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"
The default money command is 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:

GetterReturns
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.