Skip to content

Sensor

The Sensor block
Sensor. Asset render of the block model, not an in-game screenshot.

The Sensor was FilaSignal’s first detector. It only notices players. It still works in existing builds; for new builds the Entity Detector sees players, mobs and items and has richer events.

Sensor

Shapeless: put the ingredients anywhere in the grid. Older device, kept for existing builds. Ingredients: 1 × Observer, 1 × Copper Ingot. It appears in the recipe book once you pick up one of its ingredients.

Link it to a relay, such as a Network Repeater, and give it a name. In its form set the Radius (1 to 16 blocks, default 6) and the Period between checks (5 to 200 ticks, default 10), or use /filasignal sensor X Y Z RANGE PERIOD.

It cannot run a program.

The Sensor has no methods. A computer program handles its events with the sensor’s name as a filter:

EventWhen it runs
sensor.cleared("name", detected)Runs when a named Sensor sees no player any more.
sensor.detected("name", detected)Runs when a named Sensor first sees a player.

detected is true for sensor.detected and false for sensor.cleared. The sensor reports the first player to arrive and the last one to leave. When a program starts, a player already in range counts as a new arrival.

on sensor.detected("porch") {
print("Someone is on the porch")
}
on sensor.cleared("porch") {
print("The porch is empty")
}