Aller au contenu principal

Custom Enchantment Definition

Defines a custom enchantment with modular mechanics

Champs

ChampTypePar défautDescription
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostEnchantmentDefinition.Cost—Minimum cost when enchanting
EnchantmentDefinition (18)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostCost—Minimum cost when enchanting
Cost (2)
ChampTypePar défautDescription
baseInt0—
perLevelInt0—
maximumCostCost—Maximum cost when enchanting
Cost (2)
ChampTypePar défautDescription
baseInt0—
perLevelInt0—
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same itemVariantes :CustomEnchantmentDefinitionEnchantmentDefinition
CustomEnchantmentDefinition (14)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostEnchantmentDefinition.Cost—Minimum cost when enchanting
maximumCostEnchantmentDefinition.Cost—Maximum cost when enchanting
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same item
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
mechanicsList<EnchantmentMechanic>emptyList of modular mechanics for this enchantment
EnchantmentDefinition (18)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostCost—Minimum cost when enchanting
maximumCostCost—Maximum cost when enchanting
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same item
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
cooldownEnabledBooleantrueWhether active triggers use a cooldown
cooldownDurationofSeconds(1)Cooldown between active triggers
criteriaList<Criteria>emptyCriteria that must match for triggers to run
inactiveTriggersList<Ref<TriggerableEntry>>emptyTriggers fired when the enchantment becomes inactive
activeTriggersList<ActiveTriggers>emptyTriggers fired while the enchantment is active. Each entry specifies the level.
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
cooldownEnabledBooleantrueWhether active triggers use a cooldown
cooldownDurationofSeconds(1)Cooldown between active triggers
criteriaList<Criteria>emptyCriteria that must match for triggers to run
inactiveTriggersList<Ref<TriggerableEntry>>emptyTriggers fired when the enchantment becomes inactive
activeTriggersList<ActiveTriggers>emptyTriggers fired while the enchantment is active. Each entry specifies the level.
ActiveTriggers (2)
ChampTypePar défautDescription
levelInt1—
triggersList<Ref<TriggerableEntry>>empty—
maximumCostEnchantmentDefinition.Cost—Maximum cost when enchanting
EnchantmentDefinition (18)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostCost—Minimum cost when enchanting
Cost (2)
ChampTypePar défautDescription
baseInt0—
perLevelInt0—
maximumCostCost—Maximum cost when enchanting
Cost (2)
ChampTypePar défautDescription
baseInt0—
perLevelInt0—
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same itemVariantes :CustomEnchantmentDefinitionEnchantmentDefinition
CustomEnchantmentDefinition (14)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostEnchantmentDefinition.Cost—Minimum cost when enchanting
maximumCostEnchantmentDefinition.Cost—Maximum cost when enchanting
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same item
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
mechanicsList<EnchantmentMechanic>emptyList of modular mechanics for this enchantment
EnchantmentDefinition (18)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostCost—Minimum cost when enchanting
maximumCostCost—Maximum cost when enchanting
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same item
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
cooldownEnabledBooleantrueWhether active triggers use a cooldown
cooldownDurationofSeconds(1)Cooldown between active triggers
criteriaList<Criteria>emptyCriteria that must match for triggers to run
inactiveTriggersList<Ref<TriggerableEntry>>emptyTriggers fired when the enchantment becomes inactive
activeTriggersList<ActiveTriggers>emptyTriggers fired while the enchantment is active. Each entry specifies the level.
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
cooldownEnabledBooleantrueWhether active triggers use a cooldown
cooldownDurationofSeconds(1)Cooldown between active triggers
criteriaList<Criteria>emptyCriteria that must match for triggers to run
inactiveTriggersList<Ref<TriggerableEntry>>emptyTriggers fired when the enchantment becomes inactive
activeTriggersList<ActiveTriggers>emptyTriggers fired while the enchantment is active. Each entry specifies the level.
ActiveTriggers (2)
ChampTypePar défautDescription
levelInt1—
triggersList<Ref<TriggerableEntry>>empty—
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same itemVariantes :CustomEnchantmentDefinitionEnchantmentDefinition
CustomEnchantmentDefinition (14)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostEnchantmentDefinition.Cost—Minimum cost when enchanting
EnchantmentDefinition (18)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostCost—Minimum cost when enchanting
maximumCostCost—Maximum cost when enchanting
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same item
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
cooldownEnabledBooleantrueWhether active triggers use a cooldown
cooldownDurationofSeconds(1)Cooldown between active triggers
criteriaList<Criteria>emptyCriteria that must match for triggers to run
inactiveTriggersList<Ref<TriggerableEntry>>emptyTriggers fired when the enchantment becomes inactive
activeTriggersList<ActiveTriggers>emptyTriggers fired while the enchantment is active. Each entry specifies the level.
maximumCostEnchantmentDefinition.Cost—Maximum cost when enchanting
EnchantmentDefinition (18)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostCost—Minimum cost when enchanting
maximumCostCost—Maximum cost when enchanting
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same item
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
cooldownEnabledBooleantrueWhether active triggers use a cooldown
cooldownDurationofSeconds(1)Cooldown between active triggers
criteriaList<Criteria>emptyCriteria that must match for triggers to run
inactiveTriggersList<Ref<TriggerableEntry>>emptyTriggers fired when the enchantment becomes inactive
activeTriggersList<ActiveTriggers>emptyTriggers fired while the enchantment is active. Each entry specifies the level.
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same item
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
mechanicsList<EnchantmentMechanic>emptyList of modular mechanics for this enchantment
EnchantmentMechanic (6)
ChampTypePar défautDescription
eventEnchantmentEventPLAYER_ATTACKThe event that triggers this mechanicValeurs :PLAYER_ATTACKPLAYER_DEFENDBLOCK_BREAKBOW_SHOOTPROJECTILE_HITITEM_CONSUMEPLAYER_DEATHPLAYER_INTERACTARMOR_EQUIPITEM_DAMAGEFALL_DAMAGEENVIRONMENTAL_DAMAGEPLAYER_MOVESHIELD_BLOCKSNEAKSPRINT
criteriaList<Criteria>emptyConditions that must be met to execute the actions
actionsList<Ref<TriggerableEntry>>emptyActions executed when criteria are met
clientSideEffectsList<Ref<TriggerableEntry>>emptyClient-side only effects (particles, sounds) executed via packets
runOnLevelInt0Level required to run this mechanic. 0 means all levels.
chanceInt100Chance to trigger this mechanic (0-100%).
EnchantmentDefinition (18)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment
enchantmentLoreString—Lore shown on items for this enchantment
nameColorStringgrayColor of the enchantment name on items (MiniMessage tag, e.g. 'gray' or '#aaaaaa')
supportedItemsList<Material>emptyItems that support this enchantment
anvilCostInt1Cost in an anvil to combine
maxLevelInt1Maximum level of the enchantment
weightInt1Weight used for random selection
minimumCostCost—Minimum cost when enchanting
Cost (2)
ChampTypePar défautDescription
baseInt0—
perLevelInt0—
maximumCostCost—Maximum cost when enchanting
Cost (2)
ChampTypePar défautDescription
baseInt0—
perLevelInt0—
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Valeurs :ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same item
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
cooldownEnabledBooleantrueWhether active triggers use a cooldown
cooldownDurationofSeconds(1)Cooldown between active triggers
criteriaList<Criteria>emptyCriteria that must match for triggers to run
inactiveTriggersList<Ref<TriggerableEntry>>emptyTriggers fired when the enchantment becomes inactive
activeTriggersList<ActiveTriggers>emptyTriggers fired while the enchantment is active. Each entry specifies the level.
ActiveTriggers (2)
ChampTypePar défautDescription
levelInt1—
triggersList<Ref<TriggerableEntry>>empty—
treasureChanceInt0Chance (0-100%) for this enchantment to appear as a book in generated loot chests
tradeChanceInt0Chance (0-100%) for librarian villagers to sell this enchantment instead of a vanilla book trade
mechanicsList<EnchantmentMechanic>emptyList of modular mechanics for this enchantment
EnchantmentMechanic (6)
ChampTypePar défautDescription
eventEnchantmentEventPLAYER_ATTACKThe event that triggers this mechanicValeurs :PLAYER_ATTACKPLAYER_DEFENDBLOCK_BREAKBOW_SHOOTPROJECTILE_HITITEM_CONSUMEPLAYER_DEATHPLAYER_INTERACTARMOR_EQUIPITEM_DAMAGEFALL_DAMAGEENVIRONMENTAL_DAMAGEPLAYER_MOVESHIELD_BLOCKSNEAKSPRINT
criteriaList<Criteria>emptyConditions that must be met to execute the actions
actionsList<Ref<TriggerableEntry>>emptyActions executed when criteria are met
clientSideEffectsList<Ref<TriggerableEntry>>emptyClient-side only effects (particles, sounds) executed via packets
runOnLevelInt0Level required to run this mechanic. 0 means all levels.
chanceInt100Chance to trigger this mechanic (0-100%).
Champs TypeWriter communs (displayName)
ChampTypePar défautDescription
displayNameString—Display name of the enchantment

How to use it​

This is the mechanic-based definition. It has the same identity, item, cost, loot and trade fields as Enchantment Definition, and replaces the trigger fields with mechanics.

Each mechanic has:

  • event: the game event it reacts to (see the list on the main page).
  • criteria: conditions that must match for it to run.
  • actions: the entries to run, such as Lifesteal or Vein Miner. They must be written for the same event.
  • clientSideEffects: entries run right after the actions, for visual effects such as Client Particle Effect.
  • runOnLevel: the level at which it runs. 0 runs at every level; any other value must equal the current level exactly.
  • chance: percentage chance, from 0 to 100.

The level used is the highest level of the enchantment found on the main hand, off-hand or armor. To scale an effect with the level, add one mechanic per level.