Sun



The Sun is a sprite appearing in every version of Minecraft except Classic that lights up all top-most blocks while it is in the sky. When the player creates a new world the sun starts on the eastern horizon at dawn. As time passes, it will slowly move westward across the sky and over the horizon while the moon rises on the opposing horizon. Daytime lasts 10 minutes and grass blocks will spread most quickly when exposed to sunlight. The deeper underground the player is, the less sunlight will illuminate the ground, and ultimately there will be no sunlight at all. A gap or a vertical shaft in the ceiling of a cavern will allow sunlight to filter in.

Sunlight
Sunlight, in game, is the name given to the light which illuminates all blocks which do not have a shadow cast over them by a non-transparent block positioned vertically above them in the sky, or if it's raining. Clouds do not cast shadows, and shadows are not affected by the position of the sun in the sky. As of Beta 1.5, however, clouds in weather like rain or snow will be darker, and the light coming from the sunlight will not be as bright. During these storms the ambient light value during the day will be reduced to 12 from the usual 15, and in thunderstorms the light level will be reduced to 7, allowing aggressive mobs to spawn.

Sunlight (or torchlight) can be used to turn dirt blocks into grass blocks, as long as there is an illuminated grass block adjacent to the dirt.

Mobs
Hostile mobs will not spawn in sunlight, although existing mobs are affected in different ways by it. Skeletons and zombies will be set on fire upon entering an area illuminated by sunlight; however, they will not burn if standing in water or rain. Endermen will teleport away at dawn. Spiders turn neutral during the day, until damaged by a player. Existing slimes and creepers are unaffected by sunlight. As of the minecraft 1.2 snapshots, zombies and skeletons will flee to shade when burning in sunlight.

History
According to Notch, the Minecraft sun actually used to rise in the north, not in the east. This was a bug, but was left in the game. This was changed in Minecraft Beta 1.9 prerelease 4, so the sun and moon now both rise in the east.

In the 1.9 pre-release 4, both the sun and the moon were changed from being square to having a more rounded look to them. However, since 1.9 pre-release 6 they are square-shaped again, although it is unknown whether they will be back to being exactly like they were or will somehow be modified. Notch said in a Twitter post that it was for 'consistency' purposes.

Trivia

 * When the sun rises and sets the blocks change their light level depending on what angle the sun is at (giving the effect of gradually getting lighter at dawn and gradually getting darker at dusk).
 * You can't see the Sun or Moon with a render distance set to Short or Tiny.
 * The sun is also larger during sunrise and sunset.
 * The position of the sun in the sky does not affect lighting and shadows, so a device such as a sundial would be impossible.
 * You can't see the sun on the Pocket Edition.
 * In Creative Mode, it is possible to reach very high y-values using the flying feature. At a y-value of about 576, the moon will appear opposite the sun, or, at night, the sun becomes visible opposite the moon, making it seem almost as the player is in space.
 * When the player starts flying in creative mode while looking at the sun, the sun will appear to zoom out; when flying mode is stopped, the sun will zoom back to its original size. This zooming effect affects the entire player view, not only the Sun or the Moon.
 * If the player is underwater and looks at the sun, it looks the same as the sun at sunset