Daylight Detector

"We're big fans of the daylight sensor, seeing as it can sense when night falls and automatically close your doors, stopping mobs from getting in. Very handy if you're crafting in your basement and lose track of time!"

- Tom Stone

A daylight detector is a block that outputs a redstone signal based on sunlight (or lack thereof).

Obtaining
Daylight sensors can be broken fairly easily by hand, but can be broken faster by using an axe. Inverted daylight sensors cannot be collected directly, and they will drop a regular daylight sensor.

Redstone component


A daylight sensor can be used to produce redstone power in proportion to the daylight or night time.

A daylight sensor is 0.375 blocks high (3/8ths of a block). Daylight sensors cannot be moved by pistons. Water and lava will flow around daylight sensors without affecting them.


 * Placement


 * To place a daylight sensor, use the "Use Item/Place Block" control (right-click, by default).


 * A daylight sensor can be "inverted", which reverses the power levels produced by the daylight sensor. To invert a daylight sensor, use the "Use Item/Place Block" control (right-click, by default).


 * Activation


 * A daylight sensor activates when exposed to sufficient daylight (daylight detector mode) or when its sky light level drops to 0 ( inverted daylight detector mode).


 * An inverted daylight sensor activates when exposure to daylight is low enough (inverted daylight detector mode).


 * Sources of block light (torches, glowstone, etc.) cannot activate a daylight sensor.


 * Behavior


 * An active daylight sensor:
 * powers adjacent redstone dust, including below it, and redstone comparators facing away from the daylight sensor, to a power level that depends on the time of day, the weather, and the daylight sensor's sky light level (see tables below)
 * powers adjacent redstone repeaters facing away from the daylight sensor to power level 15
 * activates adjacent redstone mechanisms, including above and below, such as pistons, redstone lamps, etc.


 * A daylight sensor has no effect on other adjacent blocks (for example, it cannot power a block the way a repeater can).

Daylight Sensor
If a daylight sensor has an opaque block above it, then it will emit a weaker signal, or none at all, as it is directly proportional to the sky light.

The daylight sensor power level should be 0 from time 13680 to 22340.

Inverted Daylight Sensor
a daylight sensor will invert it. However, the output of the inverted sensor is not a simple inversion of the daylight sensor's output; it uses a much simpler algorithm that depends only on the level of light from the sky. Specifically, it outputs a signal strength of 15 minus the current light level, meaning that an inverted daylight sensor will actually output a strength of 11 at midnight, if it has line of sight with the sky. The effects of shade are applied before inverting, so shade increases the signal strength when it isn't already full, and prevents it from reaching zero.

The inverted daylight sensor cannot be obtained as an item. Mining an inverted daylight sensor will simply drop a regular daylight sensor.

Fuel
Daylight sensors can be used as a fuel in furnaces, smelting 1.5 items per block.

Data values
A daylight sensor is defined by its ID and block data, and it also has a block entity. A daylight sensor also has a block state which is expected to replace the functionality of block data in a future version.

ID
A daylight sensor's ID specifies its mode (regular or inverted).

Block data
A daylight sensor's block data stores its power level:

Block entity
A daylight sensor has a block entity associated with it which stores only its entity id and position (the minimum data for a block entity). Although the daylight sensor's block entity stores no additional data, the block entity ensures that the daylight sensor is updated every game tick. The block's block entity ID is.