Actions
On this page(6)
The actions: list is what a proc does. Each entry is a map with a type and its keys. The
list runs top to bottom. A delay pauses it, so one proc can play out over several seconds.
actions:
- type: particle # 1. a spark on the mob, at once
particle: CRIT
at: '{target_center}'
- type: delay # 2. wait half a second
ticks: 10
- type: damage # 3. then hit it for 4x the swing
amount: '{damage} * 4'
chance: 50 # but only half of the timeThe guard: chance and requirement
Every action also takes these two optional keys:
| Key | Default | What it does |
|---|---|---|
chance | always | The percent this action runs with. An expression: '5 + {level} / 100' |
requirement | always | An expression. The action runs only when it is not 0: '{level} >= 50' |
On a loop, random, parallel, flow or preset line, the guard covers everything inside.
That is how you unlock a whole effect at a level:
- type: loop
times: 3
requirement: '{level} >= 500' # the whole loop only from level 500
actions:
- { type: lightning, at: '{random_in_area}' }The 26 action types
| Category | Types | Page |
|---|---|---|
| Hitting mobs | damage | Damage |
| Feedback | message, actionbar, title, sound | Messages and Sounds |
| Visuals | particle | Particles |
| Fake entities | entity, lightning | Entities |
| Fighters | npc (and entity with attack) | Fighters |
| Timing and structure | delay, loop, random, parallel, preset | Flow Control |
| Walking mobs and paths | for-each-mob, chain, for-each-point | Mob Flows |
| Changing mobs | set-rarity, debuff, spawn-mobs, play-animation | Mob Effects |
| Rewards and buffs | give-currency, add-booster, remove-booster, potion, proc-enchants | Player Effects |
A line with preset: <id> and no type is a preset line. A type that does not exist is a
warning and that action is skipped.
Quick reference
| Type | Required keys | Main optional keys |
|---|---|---|
damage | amount | area, at, spread, execute-below |
give-currency | currency, amount | |
message / actionbar | message (or text) | |
title | title, subtitle, fade-in, stay, fade-out | |
sound | sound | volume, pitch, at, offset, category |
particle | particle | shape, at, offset, to, radius, count, spread, speed, shape keys |
entity | entity or display | at, offset, lifetime, movement, glow, scale, name, animation, attack, equipment, model |
lightning | at, offset | |
npc | count, at, skin, equipment, lifetime, attack, animation, model | |
delay | ticks | |
loop | times, actions | every |
random | entries | |
parallel | actions | |
preset | preset | with |
for-each-mob | actions | mobs, every |
chain | jumps, actions | start, radius, delay-ticks |
for-each-point | points.path, actions | points.*, every |
set-rarity | rarity or up | mobs or at |
debuff | percent, duration | id, max-stacks, refresh, mobs or at |
spawn-mobs | count | |
play-animation | animation | mobs or at |
add-booster | id, target, multiplier | name, stacking, time, persistent, if-exists, max-multiplier |
remove-booster | id | |
potion | effect, duration | amplifier, particles, icon, ambient |
proc-enchants | mode, enchants, trigger, damage |
How time works
- The game runs 20 ticks per second. Every duration in an enchant is in ticks.
- Actions without a delay between them run in the same tick.
- A
loop, arandomentry and the mob flows hold the list: the action after them runs once their last round ended. Withevery:their rounds are spread over ticks. - An
entitynever makes the next action wait. To land a hit together with a falling blade, put adelayas long as the blade's flight before thedamage. - A
parallelbranch runs beside the main list. A loop can then drop a blade and hit with it later, while the next round starts. See Flow Control.
Nesting and size limits
loop,random,parallel, the mob flows and presets can nest inside each other, up to 32 levels deep.- Presets can call presets up to 8 deep. A preset that ends up calling itself is skipped.
- One enchant expands to at most 10000 actions, presets included. Past that, the rest is skipped with a warning.
- The per-player runtime limits (sequences, actions per tick, particles, entities) are on Limits and Performance.
Effects only the owner sees
Particles, sounds, entities, lightning, fighters, messages and titles are sent to the enchant's owner only. Visitors watching their fight also get the visual ones. Hits, kills, rewards and boosters are real and apply on the server.