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

helix / EnchantmentDef

Interface: EnchantmentDef โ€‹

Defined in: core/values/enchantment/def.ts:21

An enchantment, registered with dp.enchantment(name, def). 1.21+.

dp.enchantment("scope", { description: "Scope", supportedItems: "minecraft:crossbow", slots: ["mainhand"], effects: { damage: [{ effect: ValueEffect.add(2) }] } });

Properties โ€‹

anvilCost? โ€‹

readonly optional anvilCost?: number

Defined in: core/values/enchantment/def.ts:35

Halved on a book; defaults to 1.


description โ€‹

readonly description: TextComponent

Defined in: core/values/enchantment/def.ts:22


effects? โ€‹

readonly optional effects?: EnchantmentEffects

Defined in: core/values/enchantment/def.ts:40


exclusiveSet? โ€‹

readonly optional exclusiveSet?: Enchantment | readonly Enchantment[]

Defined in: core/values/enchantment/def.ts:28

Enchantments, or one tag, it can't share an item with.


maxCost? โ€‹

readonly optional maxCost?: EnchantmentCost

Defined in: core/values/enchantment/def.ts:39

Defaults to 1 at every level.


maxLevel? โ€‹

readonly optional maxLevel?: number

Defined in: core/values/enchantment/def.ts:31

1 to 255; defaults to 1.


minCost? โ€‹

readonly optional minCost?: EnchantmentCost

Defined in: core/values/enchantment/def.ts:37

Defaults to 1 at every level.


primaryItems? โ€‹

readonly optional primaryItems?: Ingredient | readonly Ingredient[]

Defined in: core/values/enchantment/def.ts:26

Items it's offered for at a table or on traded gear; within supportedItems.


slots โ€‹

readonly slots: EnchantmentSlot[]

Defined in: core/values/enchantment/def.ts:29


supportedItems โ€‹

readonly supportedItems: Ingredient | readonly Ingredient[]

Defined in: core/values/enchantment/def.ts:24

Items, or one #tag, it can go on.


weight? โ€‹

readonly optional weight?: number

Defined in: core/values/enchantment/def.ts:33

How often it rolls at an enchanting table, 1 to 1024; defaults to 1.

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