Appearance
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? โ
readonlyoptionalanvilCost?:number
Defined in: core/values/enchantment/def.ts:35
Halved on a book; defaults to 1.
description โ
readonlydescription:TextComponent
Defined in: core/values/enchantment/def.ts:22
effects? โ
readonlyoptionaleffects?:EnchantmentEffects
Defined in: core/values/enchantment/def.ts:40
exclusiveSet? โ
readonlyoptionalexclusiveSet?:Enchantment| readonlyEnchantment[]
Defined in: core/values/enchantment/def.ts:28
Enchantments, or one tag, it can't share an item with.
maxCost? โ
readonlyoptionalmaxCost?:EnchantmentCost
Defined in: core/values/enchantment/def.ts:39
Defaults to 1 at every level.
maxLevel? โ
readonlyoptionalmaxLevel?:number
Defined in: core/values/enchantment/def.ts:31
1 to 255; defaults to 1.
minCost? โ
readonlyoptionalminCost?:EnchantmentCost
Defined in: core/values/enchantment/def.ts:37
Defaults to 1 at every level.
primaryItems? โ
readonlyoptionalprimaryItems?:Ingredient| readonlyIngredient[]
Defined in: core/values/enchantment/def.ts:26
Items it's offered for at a table or on traded gear; within supportedItems.
slots โ
readonlyslots:EnchantmentSlot[]
Defined in: core/values/enchantment/def.ts:29
supportedItems โ
readonlysupportedItems:Ingredient| readonlyIngredient[]
Defined in: core/values/enchantment/def.ts:24
Items, or one #tag, it can go on.
weight? โ
readonlyoptionalweight?:number
Defined in: core/values/enchantment/def.ts:33
How often it rolls at an enchanting table, 1 to 1024; defaults to 1.