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 mob is killed. 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 him of its own accord, and will finally be consumed by the player, adding experience points to him (a mechanic also commonly known as being "magnetic," in popular gaming terminology). Upon the player's death, he loses all accumulated experience points, reverting back to level 1. 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 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 point.

Dropping Experience Orbs
The following instances determine whether a mob drops experience upon death. 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 oxygen underwater.
 * Impact 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.
 * It is unknown if mobs knocked to their doom by arrows or other projectiles fired by the player, mobs, or dispensers will cause it to drop orbs.
 * Melee - Mobs will drop orbs if they are killed by any player's melee attack.
 * In the instance of a mob brawl, (where mobs turn on eachother) is unknown whether other mob's melee attacks will make a mob drop orbs
 * Ranged - Mobs will drop orbs if killed by an arrows fired from a player's bow.
 * It is unknown if arrows fired by dispensers cause mobs to drop orbs.
 * In the instance of a mob brawl, it is unknown if a skeleton's arrow causes a mob to drop orbs.
 * It is unknown if a snowman's snowballs will cause a mob to drop orbs
 * Magic - 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 - It is unknown whether mobs will drop orbs if killed by TNT, Creeper Explosions or Ghast Fireballs.
 * Void - It is unknown whether mobs will drop orbs if killed by the void.

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.