Experience



Experience (or XP for short) can be obtained by gathering experience orbs from mining, defeated mobs and players, breeding, fishing, and using furnaces. As tradition, experience points accumulate into experience levels. However, unlike many games, experience levels do not directly increase the character's abilities. Instead, experience is used for enchanting and anvils, to produce weapons, armor, and tools with various useful abilities.

Behavior
Most experience comes in the form of experience orbs, special items which cannot be placed in inventory or a container, but will automatically be added to the player's total when collected.

Gathering experience points from experience orbs increases the player's experience level by gradually filling a bar on the bottom of the screen until a new level is achieved when the bar is full. When the player dies, they drop level*7 # of experience orbs, up to a maximum of 100 points (enough to reach level 5). All the other experience vanishes.

Experience can be gained from several different sources:
 * As traditional, from killing monsters, which drop Experience Orbs along with any other items.
 * A mob will not drop experience unless it dies within five seconds (100 game ticks) of an attack registered as a player hit (including tamed wolves and TNT). This allows gaining experience from, say, knocking a monster off a cliff (fetching the orbs might be another question). You can also try to "claim" a burning monster by hitting or shooting it once—even if the blow doesn't kill it, if the fire does within 5 seconds, it will drop XP. (5 seconds of fire only does damage, but of course you can keep trying.)
 * Mobs killed by TNT activated by a player using Flint and Steel will drop XP as usual; however mobs killed by TNT that was activated by fire, redstone, or an explosion that wasn't player activated don't drop any experience.
 * Mobs will drop a random number of orbs, and the orbs can have different values. However, the total value will always remain within the values given below, regardless of difficulty setting.
 * Hostile mobs give more experience than passive ones. Baby animals, bats, golems, and villagers give no experience at all. The Ender Dragon gives orbs totalling 12,000 XP, over 200 times more than anything else in the game.
 * Some hostile mobs spawn with weapons, or can spawn with weapons and/or armor. As of at least version 1.6.2, these mobs give an extra 1-3 points (randomly) per piece of equipment that they spawned with. Equipment picked up after spawning doesn't count.
 * Mining (destroying) a spawner block gives a hefty amount of experience as orbs.
 * From mining any ore, except iron and gold. The orbs are produced along with the mineral item(s). If a Silk Touch pick is used to mine the ore block, the experience is not dropped, but the block can later be placed and mined normally to release the mineral and the experience.
 * The ore will still produce orbs if destroyed by an explosion, whether or not it was caused by player activated TNT.
 * From smelting any of various items.
 * Smelting any ore yields some experience, but normally only iron and gold are worthwhile. For all other ores, mining them is better.
 * Moderate amounts are gained by smelting/cooking other materials: food, clay balls or blocks, cactus, wood logs, sand, or cobblestone.
 * The experience given from smelting does not appear as orbs, but is granted immediately to the player who removes the product from the furnace.
 * The smelted material must be taken from the furnace through its GUI window. Using a hopper to unload the furnace forfeits the experience, as does dumping the contents by breaking the furnace.
 * From breeding animals, which produces orbs along with the baby animal. Breaking eggs does not give experience.
 * From fishing. The experience is awarded immediately upon reeling in the fish, even if the fish itself is not picked up.
 * A Bottle o' Enchanting releases orbs when broken.

Experience orbs
Experience orbs fade between a green and yellow color and will "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 towards a player are slowed by spider webs.

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 range of the player, they will be added to the player's experience one at a time. 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 will disappear.

Experience orbs vary in value, and most sources drop a random number of orbs with the total experience award divided among them. The general worth of an orb is reflected by its size, but the size does not increase much per point, and not at all past a certain extent. The maximum experience that can be held by orbs of various sizes follows an irregular but roughly exponential progression: 1, 3, 7, 17, 37, 73, 149, 307, 617, 1237, 2477. Thus the ender dragon drops 1 orb of the largest size (2000 points), and 10 of the next-largest (1000 points), but most mobs will be limited to the two or three smallest sizes.

Experience orbs can be destroyed by fire, lava, explosions and cacti, and can trigger pressure plates and tripwires. Although mob drops spawn the instant the final blow is dealt to the mob, experience orbs do not until the mob entity disappears and the smoke appears. When a player picks up an experience orb from a bottle o' enchanting while riding on a minecart, the minecart will stop instantly.

By using an inventory editor, you may create a “spawn experience orb” egg, the ID being 383:2, although it will not actually spawn orbs.

Leveling up
 XP required,XP diff 7,7 16,9 27,11 40,13 55,15 72,17 91,19 112,21 135,23 160,25 187,27 216,29 247,31 280,33 315,35 352,37 394,42 441,47 493,52 550,57 612,62 679,67 751,72 828,77 910,82 997,87 1089,92 1186,97 1288,102 1395,107 1507,112 1628,121 1758,130 1897,139 2045,148 2202,157 2368,166 2543,175 2727,184 2920,193 

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


 * Experience Required = 2[Current Level] + 7 (at levels 0-16)
 * 5[Current Level] - 38 (at levels 17-31)
 * 9[Current Level] - 158 (at level 32+)

One can determine how much experience has been collected to reach a level using the equations:
 * Total Experience = [Level]2 + 6[Level] (at levels 0-16)
 * 2.5[Level]2 - 40.5[Level] + 360 (at levels 17-31)
 * 4.5[Level]2 - 162.5[Level] + 2220 (at level 32+)

Useful numbers

 * Killing one large slime and all the slimes that split from it will yield from 12 to 28 experience, with an average of 19.
 * The maximum that can be used on a single enchantment is 30 levels, while the anvil will accept jobs up to level 39 (in creative mode the anvil limit is lifted).
 * 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 will give approximately 68 XP levels. The Ender Dragon actually drops 10 orbs worth 1,000 experience points, and another worth 2,000. Taken separately, the smaller orbs could take a player from zero to level 26, while the big orb would take a player from zero to level 34.
 * Maximum experience value can be gained by /xp command is 2147483648 (which is 2^31. Likely a limitation due to the 32 bit nature of Minecraft.)
 * Maximum level is 21863.

Score


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.

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: ExperienceOrb.java, changelist.txt, Level.java, Tile.java, HugeMushroomTile.java, HugeMushroomFeature.java, 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.) Afterwards, 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

 * Using enchantments does not decrease your score (which is shown on death).
 * If you gain too many experience points (such as a trillion through commands), the experience bar will disappear altogether as well as your level on your HUD. This appears to occur around level 32,767 (which is equal to (2^15)-1; the largest value representable as a 16-bit signed integer).
 * The maximum XP that you can earn from the /xp command is 2,147,483,647 levels (which is equal to (2^31)-1; the largest value representable as a 32-bit signed integer).
 * The maximum experience level is 24791 (With just /xp).
 * The maximum experience level is 32767 (With just /xp #L)(Where # is the level and the L increases the person's level by that many levels)
 * The highest level you can gain with /xp without overflowing is 1241258, which results in 2,147,483,647 exp, which is the maximum value for the int data type, in Java, which is what is used to store the exp value.
 * Large XP orbs dropped from the Ender Dragon give the player more XP.