redstone_relay
The redstone relay is a peripheral that allows reading and outputting redstone signals. While this is not very useful on its own (as computers have the same functionality built-in), this can be used with wired modems to interact with multiple redstone signals from the same computer.
The peripheral provides largely identical methods to a computer's built-in redstone API, allowing setting
signals on all six sides of the block ("top", "bottom", "left", "right", "front" and "back").
Recipe










Usage
Toggle the redstone signal above the computer every 0.5 seconds.
local relay = peripheral.find("redstone_relay") while true do relay.setOutput("top", not relay.getOutput("top")) sleep(0.5) end
Changes
- New in version 1.114.0
| setOutput(side, on) | Turn the redstone signal of a specific side on or off. |
|---|---|
| getOutput(side) | Get the current redstone output of a specific side. |
| getInput(side) | Get the current redstone input of a specific side. |
| setAnalogOutput(side, value) | Set the redstone signal strength for a specific side. |
| setAnalogueOutput(side, value) | Set the redstone signal strength for a specific side. |
| getAnalogOutput(side) | Get the redstone output signal strength for a specific side. |
| getAnalogueOutput(side) | Get the redstone output signal strength for a specific side. |
| getAnalogInput(side) | Get the redstone input signal strength for a specific side. |
| getAnalogueInput(side) | Get the redstone input signal strength for a specific side. |
| setBundledOutput(side, output) | Set the bundled cable output for a specific side. |
| getBundledOutput(side) | Get the bundled cable output for a specific side. |
| getBundledInput(side) | Get the bundled cable input for a specific side. |
| testBundledInput(side, mask) | Determine if a specific combination of colours are on for the given side. |
- setOutput(side, on)Source
Turn the redstone signal of a specific side on or off.
Parameters
- side
stringThe side to set. - on
booleanWhether the redstone signal should be on or off. When on, a signal strength of 15 is emitted.
- side
- getOutput(side)Source
Get the current redstone output of a specific side.
Parameters
- side
stringThe side to get.
Returns
booleanWhether the redstone output is on or off.
See also
- side
- getInput(side)Source
Get the current redstone input of a specific side.
Parameters
- side
stringThe side to get.
Returns
booleanWhether the redstone input is on or off.
- side
- setAnalogOutput(side, value)Source
Set the redstone signal strength for a specific side.
Parameters
- side
stringThe side to set. - value
numberThe signal strength between 0 and 15.
Throws
If
valueis not between 0 and 15.
Changes
- New in version 1.51
- side
- setAnalogueOutput(side, value)Source
Set the redstone signal strength for a specific side.
Parameters
- side
stringThe side to set. - value
numberThe signal strength between 0 and 15.
Throws
If
valueis not between 0 and 15.
Changes
- New in version 1.51
- side
- getAnalogOutput(side)Source
Get the redstone output signal strength for a specific side.
Parameters
- side
stringThe side to get.
Returns
numberThe output signal strength, between 0 and 15.
See also
Changes
- New in version 1.51
- side
- getAnalogueOutput(side)Source
Get the redstone output signal strength for a specific side.
Parameters
- side
stringThe side to get.
Returns
numberThe output signal strength, between 0 and 15.
See also
Changes
- New in version 1.51
- side
- getAnalogInput(side)Source
Get the redstone input signal strength for a specific side.
Parameters
- side
stringThe side to get.
Returns
numberThe input signal strength, between 0 and 15.
Changes
- New in version 1.51
- side
- getAnalogueInput(side)Source
Get the redstone input signal strength for a specific side.
Parameters
- side
stringThe side to get.
Returns
numberThe input signal strength, between 0 and 15.
Changes
- New in version 1.51
- side
- setBundledOutput(side, output)Source
Set the bundled cable output for a specific side.
Parameters
- side
stringThe side to set. - output
numberThe colour bitmask to set.
See also
colors.subtractFor removing a colour from the bitmask.colors.combineFor adding a color to the bitmask.
- side
- getBundledOutput(side)Source
Get the bundled cable output for a specific side.
Parameters
- side
stringThe side to get.
Returns
numberThe bundle cable's output.
- side
- getBundledInput(side)Source
Get the bundled cable input for a specific side.
Parameters
- side
stringThe side to get.
Returns
numberThe bundle cable's input.
See also
testBundledInputTo determine if a specific colour is set.
- side
- testBundledInput(side, mask)Source
Determine if a specific combination of colours are on for the given side.
Parameters
- side
stringThe side to test. - mask
numberThe mask to test.
Returns
booleanIf the colours are on.
Usage
Check if
colors.whiteandcolors.blackare on above this block.print(redstone.testBundledInput("top", colors.combine(colors.white, colors.black)))
See also
- side