Experience

Experience (EXP or XP for short) can be obtained by gathering experience orbs from mining, defeating mobs and players, breeding, trading, fishing, completing advancements, and using grindstones and furnaces. Experience gained during a player's life affects the player's score on the Game Over screen, while having no direct affect on the player character, it can be used to enhance your equipment through enchanting, or by using an anvil to repair, rename, or combine enchantments on equipment.

Experience orbs
Experience orbs fade between green and yellow colors and float or glide toward the player up to a distance of 6 blocks, speeding up as they get nearer to the player. Experience orbs pulled toward a player are slowed by spider webs. Experience orbs can also be pulled around or away from the player by running water currents.

When collected, experience orbs make a Christmas bell-like sound for a split second. Unlike resources, experience points are picked up gradually: no matter how many orbs are in the range of the player, they are added to the player's experience one at a time (around 10 orbs/second). In extreme cases, this can result in the player being followed by a swarm of orbs for many seconds. If an experience orb isn't collected within 5 minutes of its appearance, it disappears.

Experience orbs vary in value. The general worth of an orb is reflected by its size, with eleven possible sizes corresponding to specific values. The three smallest sizes are the most commonly encountered, as the majority of experience dropped by mobs and blocks is less than ten. Dense experience orbs, from values 17 and up, have orange "eyes" or "cores", and are less frequently encountered, most commonly from defeating the ender dragon, wither and other players, disenchanting objects on a grindstone, breaking spawners, and collecting items from high- traffic furnaces (currently the only way to obtain size 11 orbs in Survival mode). Unlike with dropped items, experience orbs do not merge into larger higher-value experience orbs when close to each other.

Naturally spawned orbs always have an integer value of 1–11, 17, 37, 73, 149, 307, 617, 1237, or 2477. Fishing, breeding, and trading drop a single orb with a random value in the appropriate range. Breaking blocks, killing mobs and players, smelting items, and bottles o' enchanting calculate their total experience amount and then split it into values of 1, 3, 7, 17, 37, 73, 149, 307, 617, 1237, and 2477. Higher values are chosen first, so, for example, a total value of 1000 would be dropped as orbs with values 617, 307, 73, and three 1s. Note that while the first Ender Dragon in a world drops 12,000 experience, it is dropped in 10 waves of 1000 and one of 2000, so no orbs of value 2477 are dropped. Such orbs can only exist in the world via furnaces which have had a lot of traffic.

Experience orbs with negative values can be created using the command, either using values below 0 or above 32767 due to 16-bit integer overflow. They have the smallest sprite of experience orb. While collecting them does not affect the player's experience bar in any way, they can deduct durability from a tool enchanted with Mending, provided the tool is already damaged prior to collection of the orbs.

Like items, experience orbs float when on water. Experience orbs can be destroyed by fire, lava, explosions, and cacti, and can trigger pressure plates and tripwires. Experience orbs can also stop minecarts.

$$, although mob drops spawn the instant the final blow is dealt to the mob, experience orbs do not appear until the mob entity disappears and the smoke appears.

$$, experience orbs appear in the same spatial and temporal location as loot when an entity is killed.

Leveling up


The formulas for figuring out how many experience orbs needed to get to the next level are as follows:


 * Experience required =
 * 2 × current_level + 7 (for levels 0–15)
 * 5 × current_level – 38 (for levels 16–30)
 * 9 × current_level – 158 (for levels 31+)

One can determine how much experience has been collected to reach a level using the equations:
 * Total experience =
 * level2 + 6 × level (at levels 0–16)
 * 2.5 × level2 – 40.5 × level + 360 (at levels 17–31)
 * 4.5 × level2 – 162.5 × level + 2220 (at levels 32+)
 * Google Spreadsheet with Total experience and required experience until 10000 level: https://docs.google.com/spreadsheets/d/10Ipatk8aybFNtLAPQP8iPyMzxxwhWiCfgdmobjXiaVY/edit?usp=sharing

Useful numbers

 * To get from level 0 to level 30 requires 1395 experience.
 * To get from level 27 to level 30 requires 306 experience.
 * Killing one large slime and all the slimes that split from it yield from 12 to 28 experience, with an average of 20.
 * The maximum level required for enchanting is level 30, while the anvil accepts jobs up to level 39 (in creative mode the anvil limit is removed).
 * Level 16 is a quarter of the way to level 30, while level 22 is about halfway there. Level 30 in turn, is halfway to level 39.
 * Killing the ender dragon the first time gives approximately 68 XP levels. The ender dragon actually drops 10 waves of orbs worth a total of 1,000 experience points per wave, and another worth a total of 2,000. Taken separately, the smaller waves could take a player from zero to level 26, while the big wave would take a player from zero to level 34. The largest orb dropped has a value of 1237 experience points, and can take a player from zero to level 28 all by itself.
 * Maximum experience value can be gained by command is 2147483647 which is ( - 1). This is likely due to experience being stored as a signed Java-standard 32-bit integer.
 * Maximum level of XP players can get legitimately is 21863, but they can get up to 2147483647 using commands, in this case, the experience bar may disappear and reappear.

Score


The score is the number of experience the player has collected since their last death. This number is the total experience the player has collected, rather than the amount of experience they had upon death. When the player dies, the score is displayed on the death screen.

ID




Entity data
Experience orbs have entity data associated with them that contain various properties of the entity.

History
In an image of the new lighting system, a small yellow (the orb was yellow due to a warm light from a torch) spherical shape can be seen on the left side of the screen, but a day after the photo was published Notch claimed it had an error and posted a new one, this time, without a yellow sphere. In a later tweet, Notch showed a picture of a Beta 1.7 change-list (back then the Adventure Update was supposed to be in Beta 1.7). Although it was completely blurred out and was, at first, thought of as a joke, but then Notch stated that one of the pictures with the new lighting system and the change list had a secret in them, and people all around the web started speculating.

One place that people discussed it was on the Minecraft forums, where it was discovered that the tabs at the top of the change list that were partly covered, could be decoded based on the 2-pixel tall pattern available in the image.

After a user named "tmcaffeine" successfully decoded it, the tabs read:, and RandomLevelSource(cut).



The experience level costs were heavily revised in snapshot 12w22a and 12w23a. Before these, reaching level 50 (the maximum usable on a single enchantment) required 4625 experience, corresponding to defeating 925 hostile mobs (assuming the "common" ones.) Afterward, considerably less experience is needed to get into higher levels (The amount which would formerly get the player to level 30 now gets them to level 39). Higher levels cost more experience than lower ones, but the levels are still easier to get than in 1.2.5. Now, level 30 is the maximum for enchantments, and that cost is equivalent of 165 "common" mobs, less than 1/5 the old price.

Trivia

 * If a player kills a mob by firing potions out of a dispenser, no experience is dropped.
 * Using experience on enchanting or repairing does not decrease the score which is shown upon death.
 * If the player gains too many experience points, such as 1 trillion, the experience bar and level counter completely disappear from the HUD. This appears to occur around level 32,767 or 215&minus;1, the largest value representable by a 16-bit signed integer.
 * The maximum XP that can be gained from the command is 2,147,483,647 levels or 231&minus;1, the largest value representable by a 32-bit signed integer and by Java's int type.
 * The maximum level is 238,609,311 before the experience bar disappears altogether.
 * Every 5 levels, a special XP sound plays. The sound plays each time the player reaches a multiple of 5 levels.
 * Before Beta 1.9 Prerelease 2, the score read &e0.
 * This was caused by an error in which the game renders color text. §e0 would render the text as 0, but shaded bright yellow. From Indev 0.31 (the version in which the precursor to experience, a score system, was removed after Survival Test) to this version, a bug arose where it would display &e0 instead, a common error when formatting color text in Minecraft (except on custom servers with the plugin to override this).
 * Despite being widely dropped by mobs and blocks and being obtainable from fishing, experience orbs cannot be configured using loot tables.
 * The texture file for experience orbs contains an additional five orb textures which are all identical and their purpose is unknown.