Skip to content

Backup Generator Guard

HardwareMin Tier 1Any FE battery & redstone-controlled generatorKeyless Energy (FE)Redstone Outputmplc:timers (off_delay)Local Registers
Parts1× PLC (Tier 1)2× Interface1× Energy Expansion1× Redstone ExpansionCable

Automatically fire up a fuel-burning backup generator whenever your main battery drops below 20% charge, keep it running until the battery reaches 90%, and hold it on for 5 extra seconds (off_delay) so brief power spikes never make it flicker on and off.

Mekanism Energy Cube on the left, running Tier 1 PLC in the center, and Redstone Expansion powering a lit Redstone Lamp under a generator on the right
Energy Expansion reads the Energy Cube on the left; Redstone Expansion toggles the generator circuit on the right.
  1. Place a Tier 1 Interface with an Energy Expansion against your main energy storage block (for example, a Mekanism Energy Cube or battery) and name it battery.
  2. Place a Tier 1 Interface with a Redstone Expansion against your backup generator (or redstone wire leading to it) and name it generator.
  3. Open generator’s Redstone tab:
    • Set Direction to Output.
    • Set Fault value to 0 (or 15 if your generator uses “high signal = disabled”) so the generator shuts off safely if the PLC stops or faults.
  4. Check your battery’s total capacity in FE and adjust LOW_FE and HIGH_FE in the script below (the example assumes a 1,000,000 FE battery).
backup_generator.star
load("mplc:timers", "off_delay")
BATTERY = point("battery/energy")
GEN = point("generator/redstone")
LOW_FE = 200_000 # Turn on below 20%
HIGH_FE = 900_000 # Turn off at 90%
HOLD_TICKS = 100 # Keep running 5 seconds (100 ticks) after reaching HIGH_FE
RUNNING = register("running", False)
HOLD = register("hold", [-1, False])
def scan():
stored = BATTERY.count()
if stored < LOW_FE:
RUNNING.set(True)
elif stored >= HIGH_FE:
RUNNING.set(False)
# Hold the output on briefly after RUNNING flips False to prevent flicker
active = off_delay(HOLD, RUNNING.get(), HOLD_TICKS)
GEN.set(15 if active else 0)
  • Energy is keyless, so BATTERY.count() takes no arguments and returns total FE directly.
  • The RUNNING register creates a latch (hysteresis): between 200,000 and 900,000 FE, the script keeps whatever state it was already in instead of rapidly toggling at a single threshold.
  • off_delay from mplc:timers uses its own HOLD register ([-1, False]) and counts real game ticks with now().
  • Inverted redstone generator (“high = off”): Swap the final line to GEN.set(0 if active else 15) and set the Redstone Expansion’s Fault value to 15.
  • Auto-calculate percentages: If your battery’s space() returns remaining room reliably, you can read total = BATTERY.count() + BATTERY.space()—note that space() is capped by the Interface’s put limit (20k/40k/80k FE), so fixed FE constants like LOW_FE and HIGH_FE are more accurate for large batteries.
  • Fuel-saving alarm: Add a second Redstone Output alarm that lights up if stored < 50_000 for more than 10 seconds using on_delay(ALARM_REG, stored < 50_000, 200).

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