Zum Hauptinhalt springen

Enchantment Definition

Defines a custom enchantment

Felder

FeldTypStandardBeschreibung
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)
FeldTypStandardBeschreibung
baseInt0—
perLevelInt0—
maximumCostCost—Maximum cost when enchanting
Cost (2)
FeldTypStandardBeschreibung
baseInt0—
perLevelInt0—
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Werte:ANYHANDMAINHANDOFFHANDARMORHEADCHESTLEGSFEETBODY
exclusiveWithList<Ref<RegisteredEnchantment>>emptyEnchantments that cannot coexist with this one on the same itemVarianten:CustomEnchantmentDefinitionEnchantmentDefinition
CustomEnchantmentDefinition (14)
FeldTypStandardBeschreibung
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)
FeldTypStandardBeschreibung
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)Werte: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)
FeldTypStandardBeschreibung
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)Werte: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)Werte: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)
FeldTypStandardBeschreibung
eventEnchantmentEventPLAYER_ATTACKThe event that triggers this mechanicWerte: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)
FeldTypStandardBeschreibung
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)
FeldTypStandardBeschreibung
baseInt0—
perLevelInt0—
maximumCostCost—Maximum cost when enchanting
Cost (2)
FeldTypStandardBeschreibung
baseInt0—
perLevelInt0—
activeSlotsList<EnchantSlot>emptyEquipment slots the enchantment is active in (empty = armor + hands)Werte: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)
FeldTypStandardBeschreibung
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
cooldownEnabledBooleantrueWhether active triggers use a cooldown
cooldownDurationofSeconds(1)Cooldown between active triggers
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)
FeldTypStandardBeschreibung
levelInt1—
triggersList<Ref<TriggerableEntry>>empty—
Gemeinsame TypeWriter-Felder (displayName, criteria)
FeldTypStandardBeschreibung
displayNameString—Display name of the enchantment
criteriaList<Criteria>emptyCriteria that must match for triggers to run

How to use it​

This is the trigger-based definition. Use it when you want to run TypeWriter entries while the enchantment is worn or held, rather than react to game events. For event-driven effects, use Custom Enchantment Definition.

  • Identity: name and id build the registry key typewriter:<name> (lower-case, spaces become underscores). The enchantment is also registered under its id. Avoid renaming an enchantment once items carry it. displayName and nameColor (a MiniMessage color such as gray, #aaaaaa, or a full tag such as <gradient:red:gold>) set how it is shown.
  • Items and slots: supportedItems lists the materials that can carry it. activeSlots limits where it is active; empty means armor and hands.
  • Enchanting: maxLevel, anvilCost, minimumCost and maximumCost (base plus perLevel) shape the enchanting table and anvil. In the table, weight is the percentage chance (0 to 100) of being offered, and 0 removes it from the table.
  • World: treasureChance and tradeChance are percentages for generated loot chests and librarian trades.
  • Exclusivity: exclusiveWith lists enchantments that cannot be on the same item. This is enforced in the anvil.
  • Behaviour: activeTriggers runs the listed entries for the current level (one list per level; the level must match exactly). With cooldownEnabled, they repeat every cooldown while the enchantment stays active. inactiveTriggers runs when it stops. criteria must match for either to run.