Skip to main content

Custom Enchantment Definition

Type: custom_enchantment_definition Tags: custom_enchantment_definition Defines a custom enchantment with modular mechanics rather than cooldown-based triggers. Unlike enchantment_definition, this entry uses EnchantmentMechanic to compose behaviors from multiple game events.

When to Use

Use CaseEntry Type
Cooldown-based active triggersenchantment_definition
Modular mechanics (multi-event, chance, levels)custom_enchantment_definition

Configuration

FieldTypeDefaultDescription
idString""Unique identifier for this entry
nameString""Internal name
displayNameString""Display name shown in GUIs
enchantmentLoreString""Lore line added to items (supports MiniMessage colors)
nameColorString (MiniMessage tag)"gray"Color of the enchantment name. Uses MiniMessage syntax (e.g. gray, gold, #ff5555)
supportedItemsList<Material>[]Item types that can receive this enchantment
anvilCostInt1XP levels required to combine in an anvil
maxLevelInt1Maximum obtainable level
weightInt1Rarity weight for random selection
minimumCostCost{}Minimum cost when enchanting (see below)
maximumCostCost{}Maximum cost when enchanting (see below)
mechanicsList<EnchantmentMechanic>[]Modular mechanics for this enchantment

Cost

FieldTypeDefaultDescription
baseInt0Base cost
perLevelInt0Cost per level

Mechanic

See Enchantment Mechanic for the full mechanic configuration.

Example

{
  "id": "vampiric_strike",
  "name": "Vampiric Strike",
  "displayName": "<dark_red>Vampiric Strike",
  "nameColor": "dark_red",
  "supportedItems": ["DIAMOND_SWORD", "NETHERITE_SWORD", "NETHERITE_AXE"],
  "maxLevel": 5,
  "anvilCost": 3,
  "weight": 3,
  "minimumCost": { "base": 10, "perLevel": 5 },
  "maximumCost": { "base": 20, "perLevel": 8 },
  "mechanics": [
    {
      "event": "PLAYER_ATTACK",
      "actions": ["enchantment_creator:lifesteal_action"],
      "runOnLevel": 0,
      "chance": 100
    }
  ]
}