| Method | Description |
|---|---|
isTrainPassing() | Checks if a train is detected |
getPassingTrainName() | Gets the detected train's name |
| Event | Description |
|---|---|
train_passing | Triggers when the observer detects a train |
train_passed | Triggers when the observer stops detecting a train |
isTrainPassing()
Checks if a train is currently within the train observer's range.
Returns
booleanThe state of the observer.truemeans it's outputting redstone signal.
getPassingTrainName()
Gets the name of a train within the train observer's range.
Returns
stringThe name of the train detected, ornilif none is found.
Events
The following are events that can be accessed with os.pullEvent(filter).
Event: train_passing
Triggers whenever a train enters the observer's range.
Returns
stringName of train.
Event: train_passed
Triggers whenever a train leaves the observer's range.
Returns
stringName of train.