Skip to main content

Enchantment Definition

The Enchantment Definition allows you to register a new custom enchantment with specific properties, triggers, and compatibility rules.

Configuration

enchantment_definitionMap

Configuration for the enchantment.

Properties

id

Unique identifier for this enchantment. nameString

Internal name. displayNameString

Display name shown in GUIs. enchantmentLoreString

Lore line added to items (supports colors). nameColorString (MiniMessage tag)

Color of the enchantment name on items. Uses MiniMessage syntax (e.g. 'gray', 'gold', '#ff5555'). supportedItems

"> List of item types that can receive this enchantment. maxLevelInt

Maximum obtainable level. weightInt

Rarity weight for random selection. anvilCostInt

XP levels required to combine in an anvil. minimumCostMap

Cost

base

Base cost. perLevelInt

Cost per level.

maximumCostMap

Cost

base

Base cost. perLevelInt

Cost per level.

activeSlots

" default="[]"> Equipment slots the enchantment is active in (ANY, HAND, MAINHAND, OFFHAND, ARMOR, HEAD, CHEST, LEGS, FEET, BODY). Empty means armor + hands. exclusiveWith

" default="[]"> Enchantments that cannot coexist with this one on the same item (enforced in the anvil). treasureChanceInt

Chance (0-100%) for this enchantment to appear as a book in generated loot chests. tradeChanceInt

Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade. cooldownEnabledBoolean

Whether triggers use a cooldown. cooldownDuration

Time between active triggers firing. criteria

"> Conditions required for the enchantment to be active. activeTriggers

">

Active Triggers

level

Level for these triggers. triggers

">Triggers fired while active.

inactiveTriggers

" default="[]"> Triggers fired when the enchantment becomes inactive.