Skip to content

Hubs & Standard Library

A PLC must join a Hub via the Hub’s Members tab on the same cable segment before referencing it.

Resource Limit
Shared Registers 32
Shared Channels 8
Register types bool, int, float, string
Channel capacity Equivalent to a Tier 3 resource buffer
Method Signature Description
H.register H.register(name: string) -> HubRegister Selects a pre-declared register on the Hub. Faults if not declared in the Hub UI.
H.channel H.channel(name: string) -> Point Selects a pre-declared shared buffer channel on the Hub.
  • HR.get() — returns the current committed value (or a write staged earlier in this same scan).
  • HR.set(value) — stages a write matching the register’s declared type. Committed after local registers and before move(). If several PLCs write to the same Hub register in one tick, the last committer wins in scan order.
  • Stopping, waiting, or faulting does not reset Hub registers.
  • Valid as src or dst in move() with any same-kind Point or Group.
  • Supports standard resource readings (count(), contents(), available(), space()).
  • Has no side views and is never included in points(...) wildcard groups.
  • Multiple consumer PLCs draw from committed stock in scan order.

Import timer helpers at the top of your script:

load("mplc:timers", "on_delay", "off_delay", "pulse")

All three timers measure elapsed time in game ticks via now() (20 ticks = 1 second). Precision matches the PLC’s scan interval because inputs are only observed when a scan runs.

Pass each independent timer its own local register declared as:

TIMER_REG = register("timer_reg", [-1, False])

The register stores [phase_start_tick, previous_input] (-1 when idle). Never share one state register between two timers.


Returns True once input has remained True continuously for at least ticks game ticks, staying True until input becomes False.

  • reg (Register[list]) — timer state register initialized to [-1, False].
  • input (bool) — current condition.
  • ticks (int) — delay in ticks (<= 0 passes input through immediately).
  • Restart note: Stopping the PLC preserves reg. To repeat a full delay after recovery, on_delay must observe input == False on a running scan first.

Returns True immediately while input is True, and continues returning True for ticks game ticks after input turns False.

  • reg (Register[list]) — timer state register initialized to [-1, False].
  • input (bool) — current condition.
  • ticks (int) — hold time in ticks (<= 0 follows input immediately).

Returns True for ticks game ticks on a rising edge (trigger changing from False to True), even if trigger returns to False during the pulse.

  • reg (Register[list]) — timer state register initialized to [-1, False].
  • trigger (bool) — trigger signal; must return to False before a new pulse can start.
  • ticks (int) — pulse duration in ticks (<= 0 disables output and returns False).

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