Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

spool / GuiSpec

Interface: GuiSpec<K> โ€‹

Defined in: plugins/gui/types.ts:44

What Gui is built from. Every slot not named in slots holds filler.

Type Parameters โ€‹

K โ€‹

K extends string

Properties โ€‹

background? โ€‹

readonly optional background?: string

Defined in: plugins/gui/types.ts:51

A 176x72 texture drawn behind the menu, like my_pack:gui/bench.png. Its right column must not be fully transparent, since a font glyph is only as wide as its last opaque column.


edit? โ€‹

readonly optional edit?: BarrelEdit<K>

Defined in: plugins/gui/types.ts:61

Makes the barrel an editor for the item put in one socket; see BarrelEdit. No output slot then.


filler โ€‹

readonly filler: ItemValue

Defined in: plugins/gui/types.ts:57

The locked item in unused slots. Gets this GUI's custom_data, so pass a fresh item.


ghostOpacity? โ€‹

readonly optional ghostOpacity?: number

Defined in: plugins/gui/types.ts:55

The ghost icons' opacity, 0-1 (default 0.4).


locked? โ€‹

readonly optional locked?: ItemValue

Defined in: plugins/gui/types.ts:59

What a socket whose open fails holds. Like filler, a fresh item; it must differ from filler.


look? โ€‹

readonly optional look?: ModelRef

Defined in: plugins/gui/types.ts:53

The item model the placer and the placed barrel show, like a dp.itemDefinition ref.


slots โ€‹

readonly slots: Record<K, GuiSlot>

Defined in: plugins/gui/types.ts:62


title โ€‹

readonly title: string | TellrawPart

Defined in: plugins/gui/types.ts:46

The barrel's name, shown as the menu title.

Methods โ€‹

onTake()? โ€‹

optional onTake(ctx, host): void

Defined in: plugins/gui/types.ts:69

Runs after the result is taken and the sockets are used up.

Parameters โ€‹

ctx โ€‹

FunctionContext

host โ€‹

GuiHost

Returns โ€‹

void


preview()? โ€‹

optional preview(ctx, slots, host): void

Defined in: plugins/gui/types.ts:67

Writes the output slot from the sockets, run each tick while open. Leave it empty for no result. Read and write slots through host, since the GUI may be a barrel or a minecart.

Parameters โ€‹

ctx โ€‹

FunctionContext

slots โ€‹

Record<K, ItemSlot>

host โ€‹

GuiHost

Returns โ€‹

void

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.