Skip to content

Redstone & Timers

Install a Redstone Expansion on an Interface to read redstone strength (0–15) or emit a controlled redstone signal into a block, lamp, piston, or modded machine.

Redstone ExpansionRedstone Expansion
Crafting Table
Redstone Dust
Iron Ingot
Redstone Torch
Redstone Expansion

Open the Interface screen, select the Redstone tab, and choose its Direction:

  • Input — reads the redstone signal (0 to 15) arriving at that face via P.get(). Calling P.set(...) on an input faults the scan.
  • Output — emits a signal (0 to 15) staged via P.set(level). Calling P.get() on a bare output returns its currently held output level.
lever_lamp.star
LEVER = point("lever/redstone")
LAMP = point("lamp/redstone")
def scan():
LAMP.set(LEVER.get())

Every Redstone Output has a Fault value setting (0–15, default 0). Whenever the PLC enters Stopped, Waiting, or Fault—or gets broken or unbound—the output immediately switches to its Fault value.

  • Leave Fault value at 0 for generators, quarries, or doors that should turn off if something goes wrong.
  • Set Fault value to 15 for machines that take an inverted redstone signal (“high to disable”) so they still fail safe.

Because MPLC scripts never sleep or block, the mod ships a standard timer library called mplc:timers with three functions measured in game ticks (20 ticks = 1 second):

  • on_delay(reg, input, ticks) — turns True only after input stays True continuously for ticks. Useful for waiting until a tank has been low for 5 seconds before sounding an alarm.
  • off_delay(reg, input, ticks) — turns True immediately when input is True, then stays True for ticks after input goes False. Useful for keeping a generator or pump running a few seconds extra so it never flickers on and off.
  • pulse(reg, trigger, ticks) — outputs True for ticks whenever trigger rises from False to True (a rising edge).

Give each independent timer its own local register initialized to [-1, False]:

delayed_alarm.star
load("mplc:timers", "on_delay")
LEVER = point("lever/redstone")
LAMP = point("lamp/redstone")
HELD = register("held", [-1, False])
def scan():
ready = on_delay(HELD, LEVER.get() > 0, 40) # 40 ticks = 2 seconds
LAMP.set(15 if ready else 0)

Note that stopping the PLC preserves register values, so an on_delay timer keeps its saved start tick until it observes False on a running scan.

Not an official Minecraft website. Not approved by or associated with Mojang or Microsoft.