For the complete documentation index, see llms.txt. This page is also available as Markdown.

πŸ’₯Power configuration

An enchantment power defines:

  • whether the runtime power is enabled;

  • the shared activation limits used by its triggers;

  • when the power activates;

  • which conditions, modifiers, and abilities run for each trigger.

Unlike EnchantedMobs, EnchantmentReform does not store each power in a separate file. The power is the powers section inside an enchantment file located under:

plugins/EnchantmentReform/enchantments/

The surrounding enchantment file defines registry information such as supported items, levels, rarity, and active slots. This page focuses only on its runtime variables and powers sections.

Quick start

powers:
  on-melee-attack:
    abilities:
      ignite-target:
        type: fire
        target: TARGET
        fire-ticks: 100

When the enchanted item is active and its owner directly attacks an entity, the target burns for 100 ticks.

Power structure

Section
Purpose

variables

Defines reusable level-based or calculated values for the enchantment. This section is outside powers.

powers.enabled

Enables or disables the enchantment's runtime power without changing its registry entry.

powers.limit

Controls power-wide chance, cooldown, and usage count.

powers.on-...

Defines one trigger's conditions, modifiers, and abilities.

powers.activation-abilities

Defines special abilities evaluated while deciding whether an enchantment is active.

The keys directly below powers are normally built-in triggers such as on-attack, on-damage, on-block-break, or on-fish. The exceptions are the common options above and the special activation-abilities section.

Execution flow

When a matching event occurs, EnchantmentReform processes an active enchantment in this order:

  • Conditions at the same level must all match.

  • Modifiers execute in YAML order and update supported event result data.

  • Abilities execute in YAML order after modifiers.

  • A trigger or child entry that requires unavailable context is skipped.

  • Tracked projectile continuation may reuse the power captured at launch instead of rerolling the power-wide limit.

See Power Triggers for the context supplied by each trigger and the meaning of SOURCE, SKILL, and TARGET.

Variables and dynamic values

Variables avoid repeating the same formula throughout an enchantment:

Depending on the field, values may support:

  • {level} or level;

  • enchantment variables such as {damage-multiplier};

  • formulas such as 4 + {level} * 0.5;

  • ranges such as 1~3 or 0.5~1.5;

  • level selector maps;

  • runtime placeholders such as {source_health}, {target_health_percent}, and {distance};

  • PlaceholderAPI when a player context is available.

Not every runtime placeholder is available for every trigger or ability. See Math Calculate Format for expression syntax.

Power-wide limits

Field
Default
Description

random

1

Activation chance. 1 means 100%.

cooldown

0

Shared power cooldown in seconds.

times

0

Maximum successful top-level limit passes for the power. 0 means unlimited.

These options belong under powers.limit, not inside an individual on-... trigger section.

Supported numeric fields may use formulas, variables, ranges, or level selector maps.

Trigger section

Every normal trigger uses the same basic layout:

Names such as fire-damage, reduce-fire-damage, and smoke are user-defined entry IDs. They only need to be unique inside their own section. The type value selects the registered condition, modifier, or ability implementation.

conditions

Conditions decide whether the trigger continues. Entries use logical AND by default.

Both conditions must pass. Use the any condition when one of several branches should be sufficient.

See Power Condition Reference.

modifiers

Modifiers change mutable data supplied by the current trigger before abilities run.

Examples include:

  • damage on attack or damage triggers;

  • food on food-level changes;

  • item_damage on item durability damage;

  • fishing modifiers on compatible on-fish states;

  • trade modifiers on merchant trade triggers;

  • warden_anger on Warden anger changes.

A valid modifier used with an unrelated trigger has no compatible result to change. Use the plural key modifiers.

See Power Modifier Reference.

abilities

Abilities perform actions in YAML order. They may consume entities, items, blocks, locations, projectiles, or other data supplied by the trigger.

EVENT_BLOCK only works when the selected trigger supplies a block. Individual abilities may also support their own conditions, chance, cooldown, usage limit, or child abilities as documented by that ability.

See Ability Reference.

Trigger-specific options

Some triggers add options beside conditions, modifiers, and abilities. For example, tick triggers support interval:

Trigger-specific options are documented on the Power Triggers page.

Activation abilities

activation-abilities is not an event trigger. It is evaluated while EnchantmentReform scans an item and decides which enchantments are active.

The built-in disable_enchantments ability can suppress matching enchantments found on the same item:

The enchantment declaring the rule does not disable itself. Normal trigger conditions, modifiers, and powers.limit do not apply to this special section.

Multiple triggers

One enchantment may define multiple trigger sections:

The launch trigger captures the power for projectile continuation, the tick trigger creates a trail, and the hit trigger handles the final impact.

Complete example

The enchantment adds damage when the target is below 30% health, then plays sound and particle feedback.

Last updated