Skip to content

Display Module

The Display Module block
Display Module. Asset render of the block model, not an in-game screenshot.

The Display Module is a screen. Programs write text on it, and everyone nearby can read it on the block’s front.

Display Module

Shaped crafting table recipe. Progression: intermediate automation. Ingredients: 3 × Iron Ingot, 3 × Glass Pane, 2 × Copper Ingot, 1 × Redstone. It appears in the recipe book once you pick up one of its ingredients.

Place it where people will see it; the screen faces you. Link it to a Network Repeater.

In its form, type text into the box and select Show. Use | to start a new line. Clear removes the text.

A Display Module showing two lines of green text next to a glowing alarm.
A Display Module showing FilaSignal / Hello! In-game screenshot from FilaSignal's automated client test.

The text appears in green on the block’s screen. Short messages are drawn large; longer text is drawn smaller so it still fits, so keep messages short to read them from a distance. The text is saved with the block and stays after restarts. Players only receive a display’s text, and only when it changes.

Yes: device.write(...), device.setLine(...) and the other methods. A display program often listens to other devices and shows their state; see the autonomous security tutorial.

displays.named(alias)

Refer to a Display Module by its name. Use it in a constant, then handle its events with on NAME.event(...).

Parameters: alias: string. Gives: Display. Cost: 4 operations.

const screen = displays.named("screen")

displays.from(alias)

Resolve a display module by name.

Parameters: alias: string. Gives: Display, or an error. Errors: device.type, device.unavailable, device.unknown, host.denied. Capability: display.read. Cost: 16 operations.

board, err = displays.from("lobby")

Properties: screen.connected, screen.id, screen.kind, screen.name. They are read-only.

screen.clear()

Remove all displayed text.

Gives: bool, or an error. Errors: device.type, device.unavailable, device.unknown, host.denied. Capability: display.write. Cost: 8 operations.

ok, err = board.clear()

screen.lines()

Read the displayed lines.

Gives: list, or an error. Errors: device.type, device.unavailable, device.unknown, host.denied. Capability: display.read. Cost: 8 operations.

rows, err = board.lines()

screen.setLine(index, text)

Replace one line (0–7), adding empty lines before it when needed.

Parameters: index: number, text: string. Gives: bool, or an error. Errors: argument.range, device.type, device.unavailable, device.unknown, host.denied. Capability: display.write. Cost: 16 operations.

ok, err = board.setLine(0, "Status: OK")

screen.setText(text)

Replace the text: up to 8 lines of 48 characters separated by newlines.

Parameters: text: string. Gives: bool, or an error. Errors: argument.range, device.type, device.unavailable, device.unknown, host.denied. Capability: display.write. Cost: 16 operations.

ok, err = board.setText("Iron: 64")

screen.text()

Read the displayed text with lines separated by newlines.

Gives: string, or an error. Errors: device.type, device.unavailable, device.unknown, host.denied. Capability: display.read. Cost: 8 operations.

shown, err = board.text()

screen.write(text)

Show text on the display, replacing what was there. Use for a new line.

Parameters: text: string. Gives: bool, or an error. Errors: argument.range, device.type, device.unavailable, device.unknown, host.denied. Capability: display.write. Cost: 16 operations.

board.write("Hello!")
EventWhen it runs
connectedRuns when the device becomes reachable, for example after its area loads.
disconnectedRuns when the device stops being reachable: unloaded, unlinked or removed.
programStartedRuns when the device's own program starts.
programStoppedRuns when the device's own program stops.
programFailed(message)Runs when the device's own program stops on an error.
  • 8 lines of up to 48 characters. Longer text fails with argument.range and changes nothing.
  • Control characters become spaces.
const screen = displays.named("screen")
global visitors = 0
on startup {
screen.write("Welcome!\nVisitors: " + str(visitors))
}
on timer.every(1200) {
visitors++
screen.setLine(1, "Visitors: " + str(visitors))
}