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 (ph) |
| Distance in blocks within which the mob swings and deals damage. The mob stops advancing once within this range — it is used as the chase stop distance, overriding |
| float (ph) |
| Damage dealt per swing. Applied as direct entity damage, not a weapon. |
| int (ph) |
| Ticks between strikes while the goal keeps running. See cadence. |
| boolean (ph) |
| Flash a sweep-attack particle halfway between mob and target on every strike — visual feedback for base types with no visible arm swing (pigs, …). |
| double |
| Movement speed multiplier while pathing toward target (inherited from follow-target). |
Cadence
| Behaviour |
|---|---|
| Strike once, then stop. The goal restarts through the goal selector, so the cadence is whatever the selector re-poll gives. |
| The goal keeps running and strikes every that-many ticks while the target stays in range ( |
The interval is tracked as a deadline on the entity tick rather than a countdown: goals only tick every other game tick unless requires-update-every-tick is set, which would silently double a counted-down interval.
Kill credit for owned mobs
When the mob has an owner who is online and in the same world, the strike's damage source names the mob as the direct entity and the owner as the causing entity. Everything keyed off the attacker then treats the hit as the owner's: AstralSkill's damage indicator shows it to them, the victim's healthbar is revealed to them, and the kill is recorded for them. The victim also retaliates against the owner rather than the pet, since vanilla sets lastHurtByMob from the causing entity.
Ownerless mobs — and pets whose owner is offline or in another world — keep the plain mob attack source.
Example (skeleton with melee fallback):
Example (pet striking once a second, damage scaling with its level):
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):
float
Vanilla's FloatGoal as a configurable goal: while in water (above the swim threshold) or lava, the mob repeatedly triggers its jump control so it bobs to the surface instead of sinking.
Field | Type | Default | Description |
|---|---|---|---|
| double |
| Chance per tick to trigger the jump control while floating (vanilla's value). |
Every vanilla mob has this at priority 0 — but blueprint mobs strip all vanilla goals, so any mob that can end up in water (a pet following its owner across a lake, most walkers) has to declare it:
It claims only the JUMP flag by default, so movement and look goals keep running while afloat.
follow-owner
Follows the mob's owner: paths once they get far enough away, stops advancing once close, and teleports to them when left too far behind.
Field | Type | Default | Description |
|---|---|---|---|
| double |
| The goal activates once the owner is at least this many blocks away. |
| double |
| The goal deactivates once within this many blocks of the owner. |
| double |
| Beyond this distance the mob teleports near the owner instead of pathing. Non-positive disables teleporting. |
| double |
| Radius around the owner within which a landing spot is looked for. |
| int |
| Candidate spots tried per blink before giving up. |
| double |
| Movement speed multiplier while following. |
| double |
| How far away the mob still turns to look at its owner. |
Distances use vanilla tamed-animal hysteresis: the goal only starts beyond start-distance but keeps running until within stop-distance, so a pet does not flicker between following and idling at the boundary. That gap is also what leaves room for lower-priority goals like idle-animation to run while the owner stands still.
Teleports snap to solid ground and reject landings inside blocks or liquid.
heal-owner
Support goal for pets: heals the mob's owner on a pulse whenever they are missing health.
Field | Type | Default | Description |
|---|---|---|---|
| float |
| Health restored per pulse, in half-hearts like every HP value. |
| int |
| Ticks between pulses ( |
| double |
| Only heal while the owner is within this many blocks. Non-positive disables the check — the follow/teleport goals keep a pet near its owner anyway. |
| boolean |
| Show heart particles on the owner on every pulse. |
It claims no movement flags by default, so it runs alongside follow-owner/idle-animation rather than competing with them — the pet keeps flying after its owner while topping them up. Explicitly configured flags still win, for the rare mob that wants different behaviour.
Heals go through the CraftBukkit heal path, firing EntityRegainHealthEvent with the CUSTOM reason, so other plugins observe them like any regen.
teleport-closer
Blink goal: when the mob is farther than min-distance from its target it teleports to a valid spot near the target rather than pathing there. Pairs naturally with a melee-attack that then takes over once the blink drops the mob into range.
Field | Type | Default | Description |
|---|---|---|---|
| double |
| The mob only blinks at or beyond this distance; within it, other goals handle the approach. |
| double |
| Radius of the disc around the target the mob lands in. Candidates are uniformly random inside it, so the mob may end up nearer or, occasionally, farther. |
| int |
| Minimum ticks between teleports. |
| int |
| Candidate spots tried per blink before giving up for this attempt. |
Each candidate is validated the same way as follow-owner's: snapped to solid ground, rejected inside blocks or liquid.
idle-animation
Plays a configurable, purely client-side animation sequence while the mob stands still — the pet idle animations (wolf sit, sniffer search/dig, armadillo roll, allay dance, ravager roar, …) as blueprint configuration instead of hardcoded per-type logic.
The goal activates when the mob has no target and its navigation is idle. An idle-tick counter then drives the steps: after start-delay idle ticks, each step fires when the counter reaches its at offset.
Field | Type | Default | Description |
|---|---|---|---|
| int (ticks) |
| Idle ticks before the step at |
| boolean |
| Restart the counter after the last step, so the sequence repeats while the mob stays idle. |
| int (ticks) |
| Pause before the sequence restarts when |
| List[Step] |
| The sequence (below). |
| List[Metadata] | — | Metadata applied when the goal stops — e.g. returning a sniffer to |
Each step:
Field | Type | Default | Description |
|---|---|---|---|
| int |
| Idle-tick offset (after |
| double |
| Probability (0–1) that it fires when its offset is reached. |
| List[Metadata] | — | Entity-metadata overrides to write. |
| Integer | — | Entity-status byte broadcast to every tracking player — the client interprets it for the spoofed type (e.g. |
| List[Step] | — | Variants; one is chosen uniformly at random and applied. Its own |
Each metadata entry is one client-side write: index, type (an EntityDataTypes constant name, case- and dash-insensitive — BYTE, SHORT, INT, LONG, FLOAT, BOOLEAN, STRING, ENTITY_POSE, SNIFFER_STATE, ARMADILLO_STATE) and value. Byte/short/int accept hex (0x05) as well as decimal, so bit-flag fields (sitting, rearing, dancing, …) are reachable. Indices 0-15 are shared by every mob; higher indices belong to the blueprint's spoofed type.
Overrides are forced into every outgoing metadata packet by the packet spoofing layer, so they stick. When the mob moves again — follow-owner preempting this goal, being ridden, any other movement — the goal stops, every override it wrote is dropped, and on-move is applied.
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 |
|
|
| Bob to the surface in water/lava |
|
|
| Follow (and teleport to) the owner |
|
|
| Pulse-heal the owner |
|
|
| Blink toward the target |
|
|
| Client-side idle animation sequence |
|
|
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%).