How does Minecraft perform lighting?

While the answer by Loren is mostly correct, I’d like to add that the minecraftwiki has further information.

Sunlight and moonlight works by essentially making blocks with nothing but air and glass above glow with the current lightness (15 at day, 7 at night and something between at dusk/dawn)

The falloff described by Loren means that level 0 still has 0.8¹⁵·100% = 3.5% lightness (to quote my own edit in the minecraftwiki)

The smooth lighting intruduced with Beta 1.3 works by using the light values of the adjacent blocks to generate a gradient.


Each square has a light level from 15 to 0. Each level is 20% less than the level above it. If a square contains a light source it gets the luminosity of that light source, otherwise it gets one less than the brightest neighbor.

Sunlight is special, it suffers no vertical attenuation.


If you place a light source on a flat dark place, you will get a square of light, turned around by 45°, with the middle in the light source. The size is equal to the middle light value

Natural light values are:

Clear weather: 15
Rain: 12
Rain with thunder: 10
Night: 4
Night with Rain/Thunder: 4

Note that Thunder Rain will behave like if it was night - you can sleep, mobs spawn, etc.

If this Answer scores 1pt. it's a record!