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

helix / ItemModifier

Class: ItemModifier โ€‹

Defined in: core/values/item-modifier.ts:11

An item modifier, registered with Datapack.itemModifier: a list of LootFunctions.

dp.itemModifier("sharpen", new ItemModifier().apply(LootFunction.of("set_name", { name: "Sharpened" })));

Constructors โ€‹

Constructor โ€‹

new ItemModifier(): ItemModifier

Returns โ€‹

ItemModifier

Properties โ€‹

functions โ€‹

readonly functions: LootFunction[] = []

Defined in: core/values/item-modifier.ts:12

Methods โ€‹

apply() โ€‹

apply(fn): this

Defined in: core/values/item-modifier.ts:15

Append a function to the modifier chain (applied in order).

Parameters โ€‹

fn โ€‹

LootFunction

Returns โ€‹

this

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