Light
This page contains content copied from the v1.5.2 VMC Wiki This page still requires a cleanup pass that integrates the changes from BTW to be considered correct and complete |
Lighting in Minecraft affects visibility, mob spawning, tree growth, and whether flowers and mushrooms will stay planted. Lighting can be provided by sunlight, torches, Jack 'o' Lantern, fire, lava, in-use furnaces, locked chests, Nether portals, redstone lamps, redstone repeaters, redstone comparators and certain other objects.
Contents
Effects of light
Keep in mind that light level is only one of the considerations that apply to mob spawning and plant growth. Refer to each mob's wiki page for more details.
Level 0-3 |
Level 4 |
Level 5 |
Level 6 |
Level 7 |
Level 8 |
Level 9 |
Level 10 |
Level 11 |
Level 12-15 | |
---|---|---|---|---|---|---|---|---|---|---|
Ghasts & Magma Cubes |
spawn in The Nether | |||||||||
Blazes | spawn in The Nether |
hostile | ||||||||
Wither Skeletons | spawn in The Nether |
hostile | ||||||||
Zombie Pigmen | spawn in The Nether | |||||||||
Silverfish <ref group="note">These restrictions only apply when spawning from a monster spawner, and not from a Silverfish block.</ref> | spawn in the Overworld |
spawn only from egg blocks | ||||||||
Slime | spawns in swamp biomes at levels 51-69 |
spawns in any biome at levels 0-40 | ||||||||
Zombies, Skeletons, & Creepers |
spawn in the Overworld |
hostile | ||||||||
Spiders and Cave Spiders |
spawn in the Overworld | hostile | neutral unless provoked | |||||||
Endermen | spawn in the Overworld & End |
neutral unless provoked | ||||||||
Ambience | triggered | |||||||||
Snow & ice <ref group="note">Sunlight does not affect Snow and ice.</ref> |
forms | forms and melts | melts | |||||||
Mushrooms | spread | uproot unless on mycelium | ||||||||
Flowers <ref group="note" name="plants">Applies to the light level of the block containing the flowers, saplings, or seedlings rather than the block they are planted in. Also, since moonlight is at light-level 4, flowers, saplings, & crops will not uproot if exposed to direct moonlight.</ref> | uproot | |||||||||
Trees & Crops <ref group="note" name="plants" /> |
uproot | |||||||||
Grass & Mycelium |
can't survive |
spreads to dirt blocks |
Notes: <references group="note" />
Trivia:
- The Halloween Update version Alpha 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 Alpha 1.2.1, saying, "it was way too annoying. I have plans on what to do with this."
Light-emitting blocks
The following values are the brightness of the block itself:
Icon | Block | Light Level |
---|---|---|
Template:EnvSprite | (Sunlight) | 15 |
25px | Beacon | |
25px | End Portal Block | |
25px | Fire | |
25px | Glowstone | |
25px | Jack 'o' Lantern | |
Lava | ||
25px | Locked Chest | |
25px | Redstone Lamp, when active | |
25px | Torch | 14 |
25px | Furnace, when active | 13 |
Template:EnvSprite Template:EnvSprite |
(Sunlight, when raining or snowing) | 12 |
25px | Glowing Obsidian Pocket Edition only | |
25px | Nether Portal Block | 11 |
Template:EnvSprite | (Sunlight, when thundering) | 10<ref group="note">During thunderstorms, hostile mobs are allowed to spawn as though the light level was actually 5.</ref> |
25px | Redstone Ore, when touched | 9 |
25px | Redstone Repeater, when active | |
25px | Ender Chest | 7 |
25px | Redstone Torch, when active | |
Template:EnvSprite | (Moonlight) | 4 |
25px | Brewing Stand | 1 |
25px | Brown Mushroom | |
Dragon Egg | ||
25px | End Portal block |
<references group="note"/>
Trivia:
- In Minecraft's source code, the luminescences 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.
Light Spread
The light from light-emitting blocks decreases by one light-level for each meter (block) of distance from the light source. Note that this applies to each of the 3 axes including N/S, E/W, and up/down. This fact is significant for preventing hostile mob spawning. If a torch (level 14) is placed on a wall two blocks up from the floor, the light level on the floor one block away from the wall will be 11 (e.g. 14 minus 2 down, minus 1 south). If the torch were placed on the floor at floor level, then the light level on the floor one block away from the wall will be 13 (e.g. 14 minus 0 down, minus 1 south).
Light decreases diagonally by "taxicab distance", or the sum of the distance along each axis. This means that if a torch (level 14) is placed on the floor, the light level on the adjacent floor blocks in all four direction will be 13 while the diagonal blocks in all four directions will have light level 12 (e.g. 14 minus 1 south, minus 1 east). Along a floor, this effect produces a diamond-shaped pattern of illumination around the light source. Remember, light decrease takes place in three dimensions. This means that if a torch (level 14) is placed on a wall one block up from the floor, then the block on the floor tht is diagonally one block way will have a light level of 11 (e.g. 14 minus 1 south, minus 1 east, minus 1 down).
The minimum number of light sources needed to prevent hostile mob spawning in the Overworld is difficult to determine because light decreases in all three dimensions. Given a perfectly flat plane or floor, the cheapest and easiest solution is to place torches on the floor in a diamond pattern, with 5 blocks in-between each torch diagonally.
Here, the yellow "T" represents a torch on the floor, and number is the light level of adjacent floor blocks. Note that no block is less than light level 8, which means that hostile mobs cannot spawn. The green is only to highlight the 5 blocks between each torch.
T | 13 | 12 | 11 | 10 | 9 | 8 | 9 | 10 | 11 | 12 | 13 | T |
13 | 12 | 11 | 10 | 9 | 8 | 9 | 8 | 9 | 10 | 11 | 12 | 13 |
12 | 11 | 10 | 9 | 8 | 9 | 10 | 9 | 8 | 9 | 10 | 11 | 12 |
11 | 10 | 9 | 8 | 9 | 10 | 11 | 10 | 9 | 8 | 9 | 10 | 11 |
10 | 9 | 8 | 9 | 10 | 11 | 12 | 11 | 10 | 9 | 8 | 9 | 10 |
9 | 8 | 9 | 10 | 11 | 12 | 13 | 12 | 11 | 10 | 9 | 8 | 9 |
8 | 9 | 10 | 11 | 12 | 13 | T | 13 | 12 | 11 | 10 | 9 | 8 |
However, when outdoors, if the ground level changes by even one block, this decreases light further, requiring a different pattern. Additionally, when indoors it may be more aesthetically pleasing to light sources along walls or attached to the ceiling. But this means that the light level will decrease from ceiling to floor, and the light level of the floor is used to calculate mobs spawning.
Light-filtering blocks
Solid blocks prevent the spread of light, while glass and portal interiors have no effect on light level.
All other transparent blocks reduce the spread of light. The following values are the amount each block decreases the light value. The light emitted decreases by one for each square of distance from the light source, more depending on the block it passes through.
Icon | Block | Decrease |
---|---|---|
25px | Piston Base | 6 |
Water | 3 | |
Ice | ||
25px | Slab | 2 |
25px | Stairs | |
25px | Chest | 1 |
Smooth lighting
Smooth lighting (which includes ambient occlusion as well as interpolating lighting across block faces) is the lighting engine added in Beta 1.3, with the help of MrMessiah.<ref>http://notch.tumblr.com/post/3446675806/minecraft-beta-1-3</ref> This lighting engine is set on by default, and can be enabled or disabled by accessing Video Options from the Options menu.
The engine blends lighting to add semi-realistic shadows and glowing from light sources. It darkens inside corners, resulting in small spaces appearing much darker. Before Beta 1.3, the feature could only be obtained by modifying the game with the help of MrMessiah's BetterLight mod.
In 1.5, a "Maximum" smooth lighting toggle was added, which fixes bugs with stairs. However, this is an optional toggle as it decreases performance slightly. The previous smooth lighting was put under a "Minimum" toggle.
Video
History
Minecraft has an extensive history when it comes to lighting. Classic’s lighting 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. An earlier Beta update improved upon Alpha's model by adding the smooth lighting option, and in a later Beta update, the whole lighting engine was again rewritten to be much more efficient, have more detail, and be smooth in transition of lighting differentials.
Classic
In Classic, “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 are 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% (1515) and 13 is 86.67% (1315).
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.
Minecraft - Pocket Edition currently features non-Smooth Lighting.
Alpha - Beta 1.2_02
Lighting in Alpha through pre-Beta 1.3 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. This means that Level 0 still has 0.8¹⁵·100% = 3.5% of the maximum brightness.
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.
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 ambience equivalent to normal world's level 8.
Beta 1.3 - Beta 1.7.3
Lighting from Beta 1.3 to 1.7.3 works the same as how it was in Alpha, but is greater optimized to allow smooth lighting.
Beta 1.8 - 1.4.7
In Beta 1.8, a new lighting engine was implemented. The new engine has added and changed the following:
- The lighting of an area is influenced by the type of light source that is lighting the block: moonlight gives a blue tint, torches and lava give a reddish tint, and complete darkness and sunlight are the same as before.
- Changes in lighting are now instant, and can be gradual as changes in the time of day and the state of rainfall now smoothly change the lighting value rather than individually updating the lighting of chunks one by one.
- Using the new instant lighting, non-sunlight lighting now subtly flickers, although this feature is purely cosmetic and has no effect on gameplay.
- Sunset is much more intense and realistic than before, and its intensity dims if the player turns away from it.
- At extreme depths, black fog closes in. At the bedrock level, a torch can no longer be seen from 11 squares distance. This effect is inhibited by proximity to open sky (i.e. the degree to which the place where you are standing would be lit by sunlight), whether or not the sun is currently up. Digging a shaft from the surface down to your room will allow you to see far, even at bedrock level.
- When inside the void, lighting operates similar to Classic, where objects in the void will remain at a constant brightness, regardless of how far they travel away from a light source, provided that they remain directly underneath an opening into the void. The brightness of the particular "column" of space is based on the current light level at level 0, the bottom bedrock layer. This applies to all entities, as well as particles.
- Additionally, sitting in the void underneath a shaft which allows sunlight directly into it will remove the void fog, regardless to whether is it daytime or not.
1.5
As of 1.5, there were several lighting optimizations, including more realistic lighting and lighting interacting correctly with slabs and stairs. However, furnaces emitting light from all sides, and black spots in world generation were not fixed. As well, there are now three different levels of smooth lighting: Off, Minimum, and Maximum.
Future
In snapshot Template:Verlink, Dinnerbone fixed black patches in world generation,<ref>Dinnerbonetweet:250952827608915969</ref> and began overhauling the lighting systems such as changing the lighting of blocks to allow for directional lighting.<ref name="furnace directional lighting">Dinnerbonetweet:250904989885661184</ref><ref>http://www.reddit.com/r/Minecraft/comments/10g4mi/dinnerbone_at_this_point_i_think_its_almost/</ref>
World generation issues were temporarily fixed<ref>Dinnerbonetweet:252679131261710336</ref>, but Dinnerbone reverted these changes due to performance decreases.<ref>Dinnerbonetweet:251719813704069120</ref><ref>Dinnerbonetweet:253772962530996224</ref>.
- Minecraft 2012-09-26 12-28-49.png
Fixed lighting on the furnace (front)<ref name="furnace directional lighting"/>
- Minecraft 2012-09-26 12-28-54.png
(Back)
- Minecraft 2012-09-26 12-39-06.png
Slab lighting fix<ref>Dinnerbonetweet:250907917665042432</ref>
- Minecraft 2012-09-26 12-39-34.png
Other image
Trivia
- Hostile mobs can spawn in areas where there should be light, but there isn't. This is because the game thinks there is a light level of 0.
- Smooth Lighting is not apparent on the top of water or on paintings.
- A 21 x 21 square of opaque material is enough to spawn mobs in the shadow underneath.
- If Zombies or Skeletons are in water or in the low light levels caused by trees, they can survive through the daytime.
Gallery
- 2012-03-11 15.00.48.png
Lighting, the wool block is exposed to sunlight ("Moody" brightness setting).
- 2012-03-11 15.00.53.png
Lighting, the wool block is exposed to sunlight ("Bright" brightness setting).
- Light.png
Eleven different layers of brightness ("Smooth lighting" setting disabled).
- Void Lighting.png
Lighting in the Void. Particles and entities are illuminated based on the light level at level 0, and the void fog is gone, as the player is in direct view of sunlight.