Piecewise XP Level Polynomials & Next-Level Deltas
Minecraft experience points do not scale linearly with player level. Inside Player.getXpNeededForNextLevel(), Mojang defines three linear slope regimes for the marginal XP needed to advance from current integer level L to L + 1: slope +2 per level up through level 15, slope +5 from levels 16 through 30, and slope +9 for every level at 31 and above. Summing those arithmetic progressions from 0 to L - 1 yields three exact piecewise quadratic equations for cumulative XP.
XP to Advance (L → L + 1):
0 ≤ L ≤ 15: xpNext(L) = 2L + 7
16 ≤ L ≤ 30: xpNext(L) = 5L - 38
L ≥ 31: xpNext(L) = 9L - 158
Cumulative Total XP from Level 0 to Level L:
0 ≤ L ≤ 16: TotalXP(L) = L^2 + 6L
17 ≤ L ≤ 31: TotalXP(L) = 2.5L^2 - 40.5L + 360
L ≥ 32: TotalXP(L) = 4.5L^2 - 162.5L + 2220
Despite fractional coefficients (2.5, 40.5, 4.5, 162.5), for every integer L the quadratic and linear terms share identical parity, so TotalXP(L) always evaluates to an exact whole integer.
Evaluating milestones along these three regimes exposes just how aggressively high-level hoarding inflates raw XP requirements:
| Player Level (L) | Active Polynomial Regime | Cumulative Total XP | XP for Next Level (L → L+1) | Practical Gameplay Milestone |
|---|---|---|---|---|
L = 7 |
Low (L^2 + 6L) |
91 XP |
21 XP |
Maximum XP orbs dropped on player death (min(100, 7 × L) hits 100 at L=15) |
L = 16 |
Inflection 1 Boundary | 352 XP |
42 XP |
First slope jump from +2/lvl to +5/lvl |
L = 27 |
Mid (2.5L^2 - 40.5L + 360) |
1,089 XP |
97 XP |
Post-enchantment floor after a 3-Lapis Level 30 table roll |
L = 30 |
Mid Regime Peak | 1,395 XP |
112 XP |
Minimum requirement for Slot 3 Enchantment Table pulls |
L = 31 |
Inflection 2 Boundary | 1,507 XP |
121 XP |
Second slope jump from +5/lvl to steep +9/lvl |
L = 39 |
High (4.5L^2 - 162.5L + 2220) |
2,727 XP |
193 XP |
Maximum permissible Survival anvil operation (2,727 XP from zero) |
L = 50 |
High Quadratic Tail | 5,345 XP |
292 XP |
Equivalent raw XP to 3.83× full 0 → 30 grinds |
L = 100 |
High Quadratic Tail | 30,970 XP |
742 XP |
Equivalent raw XP to 101.2 three-level table enchants at 30 → 27 |
Why Cycling Level 30 to 27 Beats Hoarding Levels
Both the Enchantment Table and the Anvil deduct levels, not fixed XP points. When you select the bottom 3-Lapis option at a 15-bookshelf Enchantment Table, you must stand at L ≥ 30, yet the craft only subtracts 3 levels from your current level.
Compute the exact raw XP delta across different starting levels:
- Spending right at Level 30 (
30 → 27):TotalXP(30) - TotalXP(27) = 1,395 - 1,089 = 306 XP(equivalently97 + 102 + 107 = 306 XP). Performing three consecutive Level 30 enchantments by topping back up from 27 to 30 each time costs3 × 306 = 918 XP—34.2% less XP than grinding from Level 0 to 30 a single time (1,395 XP)! - Spending while AFK-hoarded at Level 39 (
39 → 36):TotalXP(39) - TotalXP(36) = 2,727 - 2,202 = 525 XP(+71.6% wasted XP for the identical enchantment). - Spending at Level 60 (
60 → 57):TotalXP(60) - TotalXP(57) = 8,670 - 7,569 = 1,101 XP(3.60× more expensive than enchanting at Level 30).
The exact same principle governs anvil combining (see Prior Work Penalty Math): always refill from Level 0 only up to the exact step requirement (e.g., Level 18 or Level 21) rather than banking 55 levels first and paying top-end 9L - 158 brackets for cheap combines.
The 2-Tick Orb Immunity Bottleneck & Farm Throughput Caps
Building a faster mob grinder (see our Spawning & Farm Lab) will not raise your personal XP absorption rate once you saturate the player orb-pickup timer. Inside ExperienceOrb.playerTouch(Player), absorbing an orb sets player.takeXpDelay = 2 game ticks (0.10 seconds at 20 TPS). Because a player can absorb at most 10 orbs per second (36,000 orbs per hour), maximum XP throughput depends entirely on the average XP value per individual orb.
When a mob dies or an ore breaks, ExperienceOrb.award greedily splits the total XP drop into discrete vanilla orb denominations (2477, 1237, 617, 307, 149, 73, 37, 17, 7, 3, 1). A common misconception is that Java 1.17's orb merging bypasses the 36,000-orb ceiling. Inspection of ExperienceOrb.java proves otherwise: Java 1.17+ merges nearby identical-value orbs by incrementing an internal this.count integer to save entity MSPT (see Server MSPT Optimization), yet each touch decrements --this.count by 1 and still triggers player.takeXpDelay = 2 ticks! Your hourly XP cap remains strictly 36,000 × E[orbValue]:
| XP Source / Farm Archetype | Drop per Kill / Block | Vanilla Orb Split | Mean XP / Orb | Hard Player Absorption Ceiling |
|---|---|---|---|---|
| Sculk Block Hoe Mining | 1 XP |
[1] (1 orb) |
1.00 XP |
36,000 XP/hr |
| Enderman / Sculk Catalyst | 5 XP |
[3, 1, 1] (3 orbs) |
1.67 XP |
60,000 XP/hr |
| Zombified Piglin (Armored + Baby Mix) | 5–12+ XP |
[3, 1, 1] to [7, 3, 1, 1] |
~2.9–3.3 XP |
~105,000–120,000 XP/hr |
| Guardian / Blaze Grinder | 10 XP |
[7, 3] (2 orbs) |
5.00 XP |
180,000 XP/hr |
| Ravager / Piglin Brute | 20 XP |
[17, 3] (2 orbs) |
10.00 XP |
360,000 XP/hr |
| Banked Smelter / Ender Dragon Repeat | 500+ XP |
[307, 149, 37, 7] |
125+ XP |
4,500,000+ XP/hr (Burst) |
Mending 2:1 Durability Conversion & 1.16+ Slot Filtering
Whenever an absorbed XP orb touches the player, Mending intercepts the points before giveExperiencePoints updates your XP bar. Each point of XP repairs exactly 2 points of durability (1 XP = 2 durability). Restoring a Netherite Pickaxe from 1 durability back to 2,031 (2,030 damage) consumes 2,030 / 2 = 1,015 XP—less than a single 0 → 27 level grind (1,089 XP), or precisely 60.9 seconds standing at an Enderman farm saturated at 60,000 XP/hr (16.67 XP/sec).
Prior to Java 1.16, the game selected uniformly at random across all six equipment slots (mainhand, offhand, and four armor slots) carrying Mending—even items already at 100% durability. Wearing four undamaged Mending armor pieces wasted 4 / 5 = 80% of repair rolls straight into your XP bar instead of healing your pickaxe. Since Java 1.16 (and in 1.21.4 via EnchantmentHelper.repairPlayerItems), the candidate pool strictly filters for ItemStack::isDamaged. You never need to take off undamaged Mending armor when repairing tools at a farm; only damaged armor pieces compete with your held tool for incoming orbs.
Java Edition (1.21.4)
Enforces the 2-tick (0.1s) pickup delay on every merged orb unit. Leftover XP inside a single orb after topping off an item's final durability point overflows cleanly into a second damaged Mending item or the player's XP bar via recursive repairPlayerItems.
Bedrock Edition (1.21.50)
Uses identical piecewise level polynomials (1,395 XP at Level 30) and 2-durability-per-XP Mending ratios, and filters strictly for damaged Mending gear. However, Bedrock furnace XP banking historical bugs were patched, and mob equipment bonus XP follows separate loot rolls.
/xp set @s 0 levels and /xp set @s 0 points, then execute /xp add @s 1395 points: your XP bar lands on exact Level 30 (0.0%). Next, give yourself a nearly broken pickaxe via /give @s minecraft:netherite_pickaxe[minecraft:damage=2000,minecraft:enchantments={"minecraft:mending":1}] while wearing undamaged Mending Netherite armor, summon 100 10-XP orbs with /summon minecraft:experience_orb ~ ~ ~ {Value:10,Count:100}, and time absorption: exactly 10.0 seconds (200 ticks) elapse as all 1,000 XP restore 2,000 durability without a single point leaking into your XP bar.