Sensor

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.
How to get it
Section titled “How to get it”
SensorPlace and configure
Section titled “Place and configure”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.
Drive programs
Section titled “Drive programs”It cannot run a program.
Program API
Section titled “Program API”The Sensor has no methods. A computer program handles its events with the sensor’s name as a filter:
| Event | When 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.
Example
Section titled “Example”on sensor.detected("porch") { print("Someone is on the porch")}
on sensor.cleared("porch") { print("The porch is empty")}