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

twine / CustomItem

Function: CustomItem() โ€‹

CustomItem(meta): ClassDecorator

Defined in: twine/src/item/decorators.ts:32

Declares an item. The class is the item: pass it wherever helix takes one, and put it in a module's imports. Its behaviour goes in modules, as @OnUse(Item) and friends.

ts
@CustomItem({ name: "fire_arrow", item: FIRE_ARROW,
  recipe: (self) => RecipeDef.shapeless([...eight, "minecraft:blaze_powder"], self, 8) })
export class FireArrow {}

ctx.playerGive(sel, FireArrow, 16);

Gets a public <name>/give, and give_upgrades when it takes upgrades. Its upgrades come with it.

Parameters โ€‹

meta โ€‹

CustomItemMeta

Returns โ€‹

ClassDecorator

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