AI Goals, Targeting & Movement {id="ai-goals-targeting-movement"}
Mob intelligence is defined through three configurable behavior blocks: goals (what the mob does), target selectors (who it targets), and move control (how it moves). Each block is deserialized from the blueprint once and copied per spawn, allowing mobs to exhibit diverse, context-sensitive behaviors.
Structure Overview
A typical mob blueprint organizes behavior as:
Each block is independent but works together: goals execute in priority order, targeting supplies the mob's current target, and move control determines movement type.
Goal Selectors
Goals define the mob's action behavior. Each goal type maps to a key under goal-selectors; a key can hold either a single goal (map value) or multiple goals of the same type (list value).
Unknown keys (e.g. a clear pseudo-entry) are safely ignored, never fatal.
Shared Goal Fields
All goal types share these configurable fields:
Field | Type | Default | Description |
|---|---|---|---|
| int |
| Lower-priority goals run first; higher priority goals interrupt lower ones. Added to the mob's goal selector with this priority. |
| List |
| Enum flags: |
| boolean |
| When |
| boolean |
| When |
| boolean |
| When |
| Requirement list | None | Conditions the mob must satisfy to start this goal. Evaluated once per selection. If any requirement fails, the goal cannot be used. |
| Requirement list | None | Conditions the mob must satisfy to keep running this goal. Re-evaluated every tick when |
| Action list | None | Actions run when the goal starts (e.g. start a timer, play a sound). See amob-actions.md. |
| Action list | None | Actions run when the goal stops. |
| Action list | None | Actions run when the goal is interrupted (a higher-priority goal takes over). |
Goal Types
melee-attack
Chases the target, then strikes when within range. Extends follow-target internally.
Field | Type | Default | Description |
|---|---|---|---|
| double |
| Distance in blocks within which the mob swings and deals damage. The mob stops advancing once within this range. |
| float |
| Damage dealt per swing. Applied as direct entity damage, not a weapon. |
| double |
| Distance the mob gets close before stopping (inherited from follow-target). Overridden by |
| double |
| Movement speed multiplier while pathing toward target (inherited from follow-target). |
Example (skeleton with melee fallback):
follow-target
Chases and faces the target without striking. Useful for positioning-only mechanics or ranged attackers that should close distance without melee.
Field | Type | Default | Description |
|---|---|---|---|
| double |
| Distance in blocks at which the mob stops advancing. |
| double |
| Movement speed multiplier while chasing. |
Special behaviors:
Phasing mobs (
removePhysics: true): ignore pathfinding and beeline directly through walls toward the target.Path recalculation: re-paths after 2 ticks once the previous path is exhausted, or after 4-10 ticks (randomized) if the target has merely moved while a path is still active — avoiding the every-tick recompute that would stall movement into a near-target shuffle.
Example (chase without striking):
idle
Wanders randomly within a configurable radius of the spawn point. Yields immediately when a target appears, allowing combat goals to take over.
Field | Type | Default | Description |
|---|---|---|---|
| double |
| Wander radius around spawn, in blocks. |
| double |
| Movement speed multiplier while strolling. |
| int |
| Roughly one stroll starts per |
Example:
kite
Pure positioning: the mob tries to hold a distance band from its target, closing in when too far and backing away when too close. No attacking; useful paired with a separate skill-casting goal.
Field | Type | Default | Description |
|---|---|---|---|
| double |
| Distance in blocks the mob tries to maintain from target. |
| double |
| Half-width of the dead band around |
| double |
| Movement speed multiplier while repositioning. |
Example:
cast-skill
Extends kite: maintains a distance band and casts a skill at the target on cooldown. Requires the skill to be registered in AstralSkill. For skill DSL details, see amob-skills.md.
Field | Type | Default | Description |
|---|---|---|---|
| String | Required | Id of the skill to cast. Must be registered in AstralSkill; if not found or AstralSkill is absent, the goal behaves like |
| boolean |
| When |
| double |
| Inherited from |
| double |
| Inherited from |
| double |
| Inherited from |
Example (ranged mob with dual-cast pattern):
Target Selectors
Target selectors find and acquire targets (usually players). Each selector scans on an interval and applies filters (line of sight, path reachability, custom requirements). Like goals, a target-selectors key can map to a single selector or a list.
Currently only one type is implemented:
player
Targets players within range. Uses vanilla player scanning and optional requirement filters.
Shared Selector Fields
Field | Type | Default | Description |
|---|---|---|---|
| boolean |
| Require line of sight to acquire and maintain target. When |
| boolean |
| Require a navigable path to the target. When |
| int |
| Re-scan cadence. The mob searches for a new target roughly every |
| double |
| Detection range in blocks. Non-positive ( |
| int |
| Selector priority (lower runs first in the target selector). |
| Requirement list | None | Per-candidate filters evaluated on each scan. The candidate (player) is the requirement executor, so player-relative conditions (in region, health, permission, …) are meaningful. The mob is exposed via |
PlayerTargetMode
When multiple players pass filters, mode picks which one becomes the target. Case- and underscore-insensitive.
Mode | Behavior |
|---|---|
| Pick the nearest player (default vanilla behavior). |
| Pick a uniformly random candidate. |
| Pick the most distant candidate. |
| Pick the player with the most current health. |
| Pick the player with the least current health. |
Example:
Example with custom requirements (target only if player is at least 5 blocks away):
Move Control
Move control defines how the mob physically moves. It is a discriminated union — you must specify a type field, and the deserialization expects fields relevant to that type. Mobs without a move-control block use walking by default.
General Structure
Unknown type values fail to load (logged as an error; the mob keeps its default walking control).
walking
Standard ground movement using vanilla pathfinding. This is the default when move-control is omitted.
Field | Type | Default | Description |
|---|---|---|---|
| boolean |
| When |
Example (explicit walking with head-phasing disabled):
flying
Aerial movement with hoisting and hover-height control. Registers FLYING_SPEED attribute and swaps to FlyingPathNavigation.
Field | Type | Default | Description |
|---|---|---|---|
| int |
| Maximum turning rate (degrees per tick). Lower = slower turns. |
| boolean |
| When |
| double |
| Speed attribute value while airborne (range 0.0–1.0+). Higher = faster flight. |
| double |
| Blocks of clearance above ground the mob maintains while hovering idle (when |
Behavioral notes:
Gravity is kept off for the mob's entire lifetime when
hovers-in-placeis true, ensuring smooth hover hold.hover-heightonly takes effect while the mob is not steering toward a waypoint.For a flyer that should descend and land when target is lost, set
hovers-in-place: false.
Example (Blaze-like flyer with hover):
cube
Slime / Magma Cube style hopping locomotion. The mob bounces toward its goal instead of walking.
Field | Type | Default | Description |
|---|---|---|---|
| int |
| Minimum ground ticks between hops. |
| int |
| Maximum ground ticks between hops. Actual delay is random in |
| double |
| Jump strength attribute value. ~0.42 is a normal mob jump (~1.25 blocks high). Higher = higher hops. |
Example:
creaking
Creaking mob movement (gated / special behavior; no configuration fields).
none
No movement control; the mob is stationary. Useful for immobile bosses or triggers.
Practical Patterns
Simple Melee Mob
Chases and strikes on sight:
Ranged Caster (Skeleton)
Keeps distance and fires projectiles:
Flying Ranged Boss (Blaze)
Hovers in place and kites while casting:
Stationary Boss (Wither)
Immobile; multiple cast goals with complex timing patterns:
Creeper Clone
Self-detonates while chasing:
Summary Tables
Goal Types Quick Reference
Type | Purpose | Key Fields | Extends |
|---|---|---|---|
| Chase then strike |
|
|
| Chase without striking |
|
|
| Wander near spawn |
|
|
| Hold distance band |
|
|
| Kite + cast skill |
|
|
Target Selector Types Quick Reference
Type | Purpose | Modes |
|---|---|---|
| Target players |
|
Move Control Types Quick Reference
Type | Behavior | Key Fields |
|---|---|---|
| Ground pathfinding (default) |
|
| Aerial movement with hover |
|
| Slime-style hopping |
|
| Creaking mob (gated) | None |
| Stationary / no movement | None |
Shared Goal Flags
Flag | Effect |
|---|---|
| The goal controls horizontal movement. |
| The goal controls head rotation (look direction). |
| The goal controls jumping. |
Default |
|
Cross-References
Mob Actions — action syntax for
start-actions,stop-actions,interrupt-actions.Casting Skills — skill DSL and how
cast-skillgoals trigger them.mob Placeholders — available placeholders in requirements (e.g.
%mob_timer_*%,%mob_memory_*%,%mob_target_distance%).