Light



Lighting in Minecraft affects visibility, Mob spawning, and tree growth. Lighting can be provided by sunlight, torches, fire, lava and certain other objects.

Each edition of Minecraft uses a different lighting model. Classic's model is simple and only checks whether a block is exposed to the sky. Indev's model is more complex and considers a block's distance from the nearest sunlight and from the nearest light-emitting block. Alpha's model is a refinement of Indev's, calculating sunlight and block-emitted light separately and using a different scale of light intensities.

Classic/Survival Test
In Classic and Survival Test "sunlight" is emitted by the top edge of the map and will hit any block that is under it. It will pass through transparent blocks to light blocks underneath. Blocks that do not receive light are in a dim shadow that remains at the same level of brightness no matter how far they were from a light source.

Indev/Infdev
In Indev and Infdev versions there are 16 degrees of brightness, with a maximum of 15 for full daylight and a minimum of 0 for almost complete darkness. Brightness is a linear scale and represents its value divided by 15, so for example 15 is 100% (15/15) and 13 is 86.67% (13/15).

Each block that emits light has its own luminance value and the light value diminishes by one level each block from its source. If the neighbouring block already has a greater light value, it is ignored. The process is repeated for each block whose light value just changed.

During the day, sunlight has a maximum light value of 15. At dusk, it steadily decreases until it reaches a night-time minimum value of 4 representing moonlight. Sunlight is emitted by the top edge of the map, but does not diminish with distance from its "source". A block lit by sunlight will be equally bright at any height or depth.

Alpha
Lighting in Alpha works as Indev and Infdev, except that the scale is different and is not linear.

Full daylight provides the maximum brightness of 15. Each value below this is 80% as bright as the one above it. For example, 14 is 80% as bright as sunlight, and 13 is 64% bright.

Sunlight in Alpha has its own light array and a behind-the-scenes optimization to make dawn and dusk smoother: the amount of light from the sky is pre-calculated and saved along with the blocks, because it never needs to change except when blocks are added or removed. During dusk, nighttime, and dawn, a "darkness" value is subtracted from the sky to create the effects of different times of day.

Effects of light

 * Hostile mobs require a light level of 7 or less to spawn.
 * The Halloween Update version 1.2.0 allowed monsters to spawn in higher light levels at lower depths, using the formula 16 - (Layer ÷ 8). At level 8 and below, mobs could spawn even in sunlight. Notch reverted mob spawning to the original method in version 1.2.1, saying, "it was far too annoying. I have plans on what to do with this."
 * Planted Flowers and Saplings will stay in the ground at light level 8 or higher. Night is ignored for unobstructed zenith.
 * Friendly mobs require a light level of 9 or higher to spawn.
 * Snow and ice will melt at light level 12 or higher, and won't form at light levels above 10. Sunlight is ignored.
 * Trees will only grow in light level 10 or higher.
 * Crops will only grow in light level 9 or higher.

Blocks which emit light
The following values are the brightness of the block itself. The light emitted decreases by one for each square of distance from the light source. Glass does not diminish the light that passes through it, but water or ice reduces light that passes through it by 3. In Minecraft's source code, the luminances are defined using the floating point values in the third column. In a weird quirk, these floating point numbers are fractions of 16, but are multiplied by 15 to get the integer light value. This means that both 0/16 and 1/16 (0.0 and 0.0625) correspond to the integer light value 0.

(* A bug that exists in version 1.2.0_02, where brown mushrooms reset the light level of the tile they are on to exactly level 1, even if the tile is meant to be brighter by other means -- that is their presence can reduce an otherwise brighter tile's light level.)



The Nether
In the Nether, light decreases by 10% each level, rather than the normal 20%. This means it will never be totally dark in the Nether. The minimum light value is 20.59%, providing a permanent dim ambiance equivalent to normal world's level 8.