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

twine / ItemParts

Interface: ItemParts โ€‹

Defined in: twine/src/item/types.ts:111

An item's registered pieces, from itemOf.

Properties โ€‹

give โ€‹

readonly give: FunctionRef

Defined in: twine/src/item/types.ts:115

The public <name>/give function.


item โ€‹

readonly item: ItemValue

Defined in: twine/src/item/types.ts:113

The item. A fresh copy each read, since items change in place.


mod โ€‹

readonly mod: ModParts

Defined in: twine/src/item/types.ts:121

For an upgrade: what it installs. Throws for anything else.


mods โ€‹

readonly mods: Mods

Defined in: twine/src/item/types.ts:119

The upgrades it takes; a bench's are its item's. Throws for an item that takes none.

Methods โ€‹

holders() โ€‹

holders(): Selector

Defined in: twine/src/item/types.ts:117

Players holding the item. A fresh selector each call.

Returns โ€‹

Selector


variant() โ€‹

variant(key): VariantParts

Defined in: twine/src/item/types.ts:123

The variant under key. Throws for a key it doesn't have.

Parameters โ€‹

key โ€‹

string | number

Returns โ€‹

VariantParts

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