Mob Flows
On this page(5)
A flow runs its own actions many times: once per selected mob, per chain jump, or per point of a path. Inside, a flow position ({mob_pos}, {to_pos}, {point_pos}) tells the
actions where the current round is.
| Flow | Runs its actions once per | Inside |
|---|---|---|
for-each-mob | Mob of a selection made when it starts | {mob_pos}, {mob_health}, {mob_health_percent} |
chain | Jump from mob to mob | {from_pos}, {to_pos}, {jump} |
for-each-point | Point of a path (the area border, a circle, a line, a grid) | {point_pos}, {point_index}, {point_count} |
The flows walk your alive zone mobs and your mob area only. Nothing happens while the zones
module is off. Each mob, jump or point counts as one action against
enchants.max-actions-per-tick. The action after a flow runs once the flow ended; wrap the flow in
a parallel to go on at once.
The mobs selector
for-each-mob, set-rarity, debuff and play-animation pick mobs with the same mobs: block.
mobs: { from: '{target_pos}', radius: 8, max: 5, order: lowest-health, exclude-target: false }| Key | Default | What it does |
|---|---|---|
from | {target_pos} | Where the search starts. Its offset goes inside mobs |
radius | none | Blocks around from. None = every alive mob of yours |
min-radius | none | Leaves out mobs at that distance or nearer. With radius: a ring |
max | 1000 | The most mobs, 1 to 1000. all = every mob found, up to 1000 |
order | nearest | Which mobs first (below) |
exclude-target | false | true leaves out the mob that procced |
order | Mobs first |
|---|---|
nearest / farthest | Nearest / farthest from from |
random | A random order |
lowest-health / highest-health | Least / most health left |
lowest-health-percent / highest-health-percent | Least / most share of their max health left |
On equal health or share, the nearest goes first.
for-each-mob
- type: for-each-mob
mobs: { from: '{target_pos}', radius: 8, max: 5, order: lowest-health }
every: 2
actions:
- type: damage
at: '{mob_pos}'
amount: '{damage} * (1 + (100 - {mob_health_percent}) / 100)'
- { type: particle, particle: CRIT, at: '{mob_center}', count: 8 }| Key | Default | What it does |
|---|---|---|
mobs | every alive mob | The selector |
every | 0 | Ticks between two mobs, 0 to 1200 |
actions | required | The list run for each mob |
The selection is made once, when the flow starts. A mob that died meanwhile is skipped. Inside,
{mob_health} and {mob_health_percent} are read when the round starts.
# Every mob 4 to 10 blocks away (a ring), healthiest first.
mobs: { from: '{target_pos}', min-radius: 4, radius: 10, max: all, order: highest-health-percent }
# The farthest mob of yours, wherever it is.
mobs: { order: farthest, max: 1 }
# The 3 nearest mobs, not the one you hit.
mobs: { radius: 5, max: 3, exclude-target: true }chain
Jumps from mob to mob. Each jump lands on the nearest alive mob within radius of where it
starts that this chain did not visit yet. It runs its actions there, and the next jump starts from
that mob. It stops at the first jump with no such mob.
- type: chain
start: target
jumps: 7
radius: 8
delay-ticks: 3
actions:
- { type: particle, particle: ELECTRIC_SPARK, shape: line, at: '{from_center}', to: '{to_center}', count: 20 }
- { type: damage, at: '{to_pos}', amount: '{damage} * 5 * pow(2, {jump} - 1)' }
- { type: sound, sound: ENTITY_LIGHTNING_BOLT_IMPACT, at: '{to_pos}', volume: 0.5, pitch: 1.6 }| Key | Default | What it does |
|---|---|---|
start | target | target = from the mob that procced (never visited again); player = from your feet when it starts |
jumps | required | The most jumps, 0 to 1000 |
radius | 6 | The reach of one jump, in blocks |
delay-ticks | 0 | Ticks after each jump's actions, 0 to 1200 |
actions | required | The list run at each jump |
Inside: {from_pos} (where the jump starts), {to_pos} (the mob it lands on) and {jump} (1, 2,
3...). An entity does not wait for its movement: a delay as long as its lifetime makes the hit
land with it.
# A slime that hops from mob to mob, harder on each hop.
- type: chain
start: target
jumps: 6
radius: 6
actions:
- { type: entity, entity: SLIME, at: '{from_pos}', movement: { type: jump-to, to: '{to_pos}', height: 2 }, lifetime: 8 }
- { type: delay, ticks: 8 }
- { type: damage, at: '{to_pos}', amount: '{damage} * 3 * {jump}' }for-each-point
Runs its actions once per point of a path. The points are computed once, when it starts.
- type: for-each-point
points: { path: area-border, count: 12, order: clockwise, start: north-west, y-offset: 0.5 }
every: 2
actions:
- { type: particle, particle: FLAME, at: '{point_pos}', count: 5, spread: '0.1, 0.3, 0.1' }| Key | Default | What it does |
|---|---|---|
points.path | required | The path (below) |
points.count | 8 | 1 to 1000 (unused by area-corners) |
points.radius | 3 | A circle's radius |
points.from | {target_pos} | A circle's center, a line's start. Its offset goes inside points |
points.to | {player_pos} | A line's end |
points.y-offset | 0 | Blocks added to the height of every point (the area paths: above the floor) |
points.order | clockwise | clockwise, counter-clockwise (seen from above; a line backwards) or random (shuffled each time it starts) |
points.start | north-west | north-west, north-east, south-east or south-west: the corner (or a circle's direction) the walk starts at |
every | 0 | Ticks between two points, 0 to 1200 |
actions | required | The list run at each point |
path | Points |
|---|---|
area-border | count points evenly on the border of your mob area, from the start corner |
area-corners | The 4 corners of the area |
circle | count points on a flat circle of radius around from |
line | count points from from to to, both ends included |
grid | count cell middles over the area, row by row |
random-in-area | count random columns of the area |
The area paths sit on the area floor plus y-offset. Without a mob area the flow does nothing,
reported once. A grid and random-in-area change their order only with order: random.
# 6 lightnings around the mob, one every 3 ticks.
- type: for-each-point
points: { path: circle, count: 6, radius: 4, from: '{target_pos}', order: counter-clockwise, start: south-east }
every: 3
actions:
- { type: lightning, at: '{point_pos}' }
# Wardens rise along the area border; each one hits the mob nearest to it.
- type: for-each-point
points: { path: area-border, count: 8, order: clockwise, start: north-west }
every: 5
actions:
- { type: entity, entity: WARDEN, at: '{point_pos}', glow: dark_aqua, lifetime: 30 }
- type: for-each-mob
mobs: { from: '{point_pos}', order: nearest, max: 1 }
actions:
- { type: particle, particle: SONIC_BOOM, shape: line, at: '{point_pos}', offset: '0, 1.8, 0', to: '{mob_center}', count: 16 }
- { type: damage, at: '{mob_pos}', amount: '{damage} * 8' }Nesting flows
Flows nest. A for-each-mob inside a for-each-point picks mobs from each point, as in the
warden example. Inside nested flows each position keeps its own meaning: {point_pos} stays the
point while {mob_pos} is the mob found from it.