> For the complete documentation index, see [llms.txt](https://enchantedmobs.superiormc.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enchantedmobs.superiormc.cn/configs/mob-powers.md).

# Mob Powers

A mob power is one YAML file that defines:

* which mobs may receive the power;
* how the power is displayed;
* when the power may activate;
* what its triggers do.

Power files are stored in:

```
plugins/EnchantedMobs/powers
```

The filename without `.yml` is the power ID. For example, `WebArrow.yml` creates the power ID `WebArrow`.

{% hint style="warning" %}
EnchantedMobs 2.0.0 uses typed `conditions`, typed `modifiers`, and typed `abilities`. Read the [2.0.0 migration guide](/info/2.0.0-migration.md) before reusing a 1.x custom power.
{% endhint %}

## Quick start

```yaml
enabled: true
placeholder: 'Flame Touch'

apply-rules:
  weight: 10

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

This power may be selected during power generation. When its owner directly attacks an entity, the target burns for 100 ticks.

## Power file structure

```yaml
# Display and availability
enabled: true
hide-name: false
placeholder: '{lang:power.example}'

# Reusable values
variables:
  damage-multiplier: '1 + {level} * 0.02'

# Power generation
apply-rules:
  group: attack
  group-unique: true
  weight: 10
  level-weight: 20
  conflicts:
    - OtherPower
  match-entity:
    entity-types:
      - ZOMBIE
      - SKELETON

# Power-wide activation limits
limit:
  random: 1
  cooldown: 0
  times: 0
  no-attack-ticks: 0

# Trigger sections
on-attack:
  conditions: {}
  modifiers: {}
  abilities: {}
```

| Section       | Purpose                                                                     |
| ------------- | --------------------------------------------------------------------------- |
| `enabled`     | Enables or disables the power.                                              |
| `hide-name`   | Hides the power from mob-name and BossBar power lists without disabling it. |
| `placeholder` | Defines the visible power name.                                             |
| `variables`   | Defines reusable dynamic values.                                            |
| `apply-rules` | Controls mob matching, weight, cost, groups, and conflicts.                 |
| `limit`       | Controls power-wide chance, cooldown, usage count, and idle-target timing.  |
| `on-...`      | Defines one trigger's conditions, modifiers, and abilities.                 |

## Execution flow

When a matching trigger fires, EnchantedMobs processes the power in this order:

```
power limit
  → trigger conditions
  → trigger modifiers
  → trigger abilities
  → final event result
```

* Conditions must all match.
* Modifiers execute in YAML order.
* Abilities execute in YAML order.
* Power effects do not recursively trigger new EnchantedMobs power events.

See [Power Triggers](/configs/triggers.md) for every built-in trigger, its `SOURCE` / `SKILL` / `TARGET` context, compatible result data, and projectile-continuation behavior.

## Display and availability

```yaml
enabled: true
hide-name: false
placeholder: '{lang:power.example}'
```

### `enabled`

When `false`, the power does not participate in generation or execute.

### `placeholder`

Controls the power text shown in mob names and BossBars. It supports language placeholders and supported dynamic values such as `{level}`.

### `hide-name`

When `true`, the power remains active but is omitted from:

* `{powers}` in mob-name formats;
* `{powers_full}` in BossBar titles;
* the visible-power count used by name truncation.

If every assigned power is hidden, the entity keeps its base mob or custom name. The bundled `HealthMultiplier` power is hidden by default.

## Variables and dynamic values

Variables avoid repeating the same formula:

```yaml
variables:
  damage-multiplier:
    '<20': 1.1
    '>=20;;<50': 1.25
    '>=50': 1.5

on-attack:
  modifiers:
    scale-damage:
      type: damage
      operation: MULTIPLY
      value: '{damage-multiplier}'
```

Depending on the field, values may support:

* `{level}`;
* power 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 viewer is available.

```yaml
value:
  '<=10': 2
  '>10;;<30': '{level} * 0.25'
  '>=30': 10
```

See [Math Calculate Format](/format/math-calculate-format.md) for expression syntax.

## Power generation rules

`apply-rules` controls whether the power is eligible and how it is selected:

```yaml
apply-rules:
  group: ranged_projectile
  group-unique: true
  weight: 5
  level-weight: 15
  conflicts:
    - AnotherProjectilePower
  match-entity:
    equip:
      main-hand:
        material:
          - BOW
          - CROSSBOW
```

Common responsibilities include:

* matching entity type, equipment, health, tags, plugins, and other entity properties;
* setting normal and level-based selection weights;
* assigning a level cost;
* preventing duplicate selections from one group;
* defining conflicting powers;
* forcing a power to be selected.

See [Mechanics](/configs/mechanic.md) for the complete generation process and field reference.

## Power-wide limits

```yaml
limit:
  random: 0.5
  cooldown: 8
  times: 3
  no-attack-ticks: 100
```

| Field             | Default | Description                                                                                         |
| ----------------- | ------- | --------------------------------------------------------------------------------------------------- |
| `random`          | `1`     | Activation chance. `1` means 100%.                                                                  |
| `cooldown`        | `0`     | Shared power cooldown in seconds.                                                                   |
| `times`           | `0`     | Maximum successful top-level activations. `0` means unlimited.                                      |
| `no-attack-ticks` | `0`     | Requires the owner to have a target without successfully attacking it for at least this many ticks. |

These settings apply to the whole power. Individual modifiers and abilities may also have their own conditions, chance, and cooldown. Abilities additionally support their own `times` limit.

Tracked projectile tick and hit executions use the powers captured at launch and do not reroll these top-level limits.

## Trigger section

Every trigger uses the same layout:

```yaml
on-damage:
  conditions:
    fire-damage:
      type: damage_cause
      values:
        - FIRE
        - FIRE_TICK

  modifiers:
    reduce-fire-damage:
      type: damage
      operation: MULTIPLY
      value: 0.5

  abilities:
    smoke:
      type: particle
      target: TARGET
      particle: SMOKE
      count: 10
```

### `conditions`

Conditions decide whether the trigger continues. Entries use logical AND and each entry requires a unique key and a `type`.

See [Power Condition Reference](/configs/power-conditions.md).

### `modifiers`

Modifiers change supported event result data before abilities run. They execute in YAML order.

Use the plural key `modifiers`, not the legacy singular key `modifier`.

See [Power Modifier Reference](/configs/power-modifiers.md).

### `abilities`

Abilities perform actions in YAML order. Each entry requires a unique key and a `type`.

See [Ability Reference](/configs/info-of-abilities.md).

## Complete example: web projectile

```yaml
enabled: true
placeholder: '{lang:power.web_arrow}'

apply-rules:
  group: ranged_projectile
  group-unique: true
  weight: 5
  level-weight: 15
  match-entity:
    equip:
      main-hand:
        material:
          - BOW
          - CROSSBOW
          - TRIDENT

limit:
  random:
    '>=15;;<23': 0.3
    '>=23': 0.6
  cooldown:
    '>=15;;<22': 10
    '>=22': 5

on-shoot-bow:
  abilities:
    capture-power:
      type: mark

on-projectile-tick:
  abilities:
    trail:
      type: particle
      target: SKILL
      particle: WHITE_ASH
      count: 6
      offset-x: 0.05
      offset-y: 0.05
      offset-z: 0.05

on-projectile-hit:
  abilities:
    place-web:
      type: place_block
      block: COBWEB
      duration: '{level} * 4'

    sound:
      type: sound
      sound: BLOCK_WOOL_PLACE

    particles:
      type: particle
      particle: BLOCK
      count: 20
      block: COBWEB

    remove-projectile:
      type: remove
      target: SKILL
```

The launch trigger captures the power for the projectile. The tick trigger creates its trail, and the hit trigger places a temporary cobweb at the hit location.

## Related references

* [Power Triggers](/configs/triggers.md): trigger contexts, event differences, result compatibility, and projectile continuity.
* [Mechanics](/configs/mechanic.md): power generation, weights, levels, groups, and conflicts.
* [Power Condition Reference](/configs/power-conditions.md): every built-in condition.
* [Power Modifier Reference](/configs/power-modifiers.md): every built-in modifier.
* [Ability Reference](/configs/info-of-abilities.md): every built-in ability.
