Experience Orb

Experience Orb is a feature that appeared in Beta 1.8. They appear as an orb that fades between a green and pale yellow color.

Behavior
Experience orbs drop when a killed mob's corpse vanishes (unlike dropped resources which appear at death). Upon the player's death, he or she loses all accumulated experience points, reverting back to level 0. Accumulated experience orbs will drop as well.Experience orbs earned from defeating enemies will only drop if the mob has been killed by the player, as opposed to a mob grinder.

Experience Orbs vary in value, depending on what dropped them. Orbs dropped by mobs are often worth one to three experience, while orbs dropped by a high level player (in SMP - PvP) may be worth tens or even hundreds of points, depending on how high a level the player was. 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.

When a player is within a 4 to 5 block range from an orb, the orb will be drawn toward the player and fly around them of its own accord, and will finally be consumed by the player, adding experience points to the player (a mechanic also commonly known as being "magnetic," in popular gaming terminology). 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.

Dropping Experience Orbs
The following instances determine whether a mob drops experience upon death.In general - mobs drop experience orb if they died by the player. Note that only the killing blow counts - a mob can be damaged to near-death by environmental damage, but if the final blow was dealt by a player, the mob would drop orbs. This allows for "Kill Stealing" or "Weathering Down" mobs for easy experience.


 * Death by Fire/ Lava - Mobs will not drop orbs if killed by fire, lava or burning.
 * However, if the mob was ignited by an enchanted sword, and the following burning damage kills the mob, it will drop orbs.
 * Suffocation - Mobs will not drop orbs if suffocated by a solid block
 * Drowning - Mobs will not drop orbs if they run out of air underwater.
 * Fall Damage - Mobs will not drop orbs if they fall to their deaths.
 * However, if the player was the last entity/block the mob was in contact with before hitting the ground, it will drop orbs. This includes using knockback or sprint attacks to send a mob off a fatal drop. Orbs are often found around dead mobs.
 * It is known that mobs knocked to their doom by arrows or other projectiles fired by the player, mobs, or dispensers will cause it to drop orbs. Dispensers only work if an arrow caused the fall.
 * Melee - Mobs will drop orbs if they are killed by any player's melee attack.
 * In the instance of a mob brawl, (when mobs attack each other), mobs will not drop orbs.
 * In the instance of a player's wolf dealing the last damage, mobs "will" drop orbs.
 * Ranged - Mobs will drop orbs if killed by an arrows fired from a player's bow.
 * Mobs killed by dispensers will not drop orbs.
 * In the instance of a mob brawl, a skeleton's arrow will cause a mob to drop orbs.
 * A Snow Golem's snowballs will not cause a mob to drop orbs
 * Alchemy/Potions - Mobs will drop orbs if killed by instant damage potions thrown by the player
 * However, instant damage potions fired from dispensers won't cause mobs to drop orbs
 * Explosion - Mobs will not drop orbs if killed by TNT, Creeper Explosions, Ghast Fireballs or by Blaze Fireballs
 * However, a Ghast killed by its own rebounded fireball will drop orbs, but not if it was another Ghast's fireball.
 * Void - It is likely that mobs will not drop orbs in the Void, as the killing blow is never dealt by the player. However, this will not matter since the orbs wouldn't be obtainable in regular gameplay.

History
In a photo 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 1 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.jav(a?), HugeMushroomFeature.(java?), RandomLevelSource(cut) Notch officially showcased the orb live at the PAX prime 2011 event in Seattle. The orb was published in the 1.8 leaked Pre-release version, where it will never despawn and will drop separately from other orb, which caused extensive amounts of lag. Finally they were officially released in the 1.8 update.

Trivia

 * 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.
 * Experience orbs pulled towards a player are slowed by spider webs.
 * Experience orbs can be destroyed by fire, lava, explosions and cacti just like dropped items.
 * Experience orbs will despawn after five minutes, in a similar fashion to dropped items.

Bugs

 * In Beta 1.9 Pre-release 4, in areas of light level 0, dropped experience orbs appear black.


 * The new sound for collecting experience orbs does not play in SMP (version 1.0.0.) but instead, plays the usual pickup sound.
 * In multiplayer, experience points do not drop when a player dies. (Although in singleplayer, this has been found to happen too.)
 * If a player has more than 11 levels of experience upon death, they will only be able to pick up 11 levels worth.
 * Often times, especially in SMP, experience orbs will not be picked up by the player as they move and will appear to "orbit" around the player.The only way to fix this glitch is to let someone else "steal" them or to stand still and let them be collected(though sometimes you will have to move in order to pick them up)