Skip to main content

AI & Goal Selectors

You can customize mob pathfinding and targeting behaviors using the AIGoalSelectors configuration list. This allows you to clear standard AI behaviors and register specific actions with custom priorities.


Configuration Syntax

Goal selectors are defined under the options block of a mob configuration file as a list of strings:

{
name: "Patrol Guard",
type: "ZOMBIE",
health: 40,
options: {
AIGoalSelectors: [
"0 clear",
"1 patrol 10,64,10;20,64,20;30,64,10",
"2 lookatplayers",
"3 float"
]
}
}
  • Priority Prefix: The number prefix (e.g. 1 in 1 patrol ...) specifies the priority of the goal. Lower numbers indicate higher priority.
  • Parameters: Some custom goals take parameters following their name (e.g., coordinates, distances, or speeds).

Supported AI Goals

General / Vanilla Goals

These control vanilla Minecraft behaviors. Mobs can only use these goals if their vanilla entity type supports them naturally.

Goal Name / AliasDescription
clear / resetRemoves all existing AI goals from the mob.
float / swimMakes the mob swim/float in water.
lookatplayersMakes the mob look at nearby players.
lookattargetMakes the mob look at its current target.
randomlookaround / lookaroundMakes the mob randomly look around.
opendoor / opendoorsAllows the mob to open doors it runs into.
breakdoorsAllows the mob to break down doors it runs into.
eatgrassMakes the mob occasionally eat grass (Sheep behavior).
meleeattackBasic melee attack behavior.
zombieattackZombie-specific melee attack behavior.
spiderattackSpider-specific pouncing attack behavior.
leapattargetMakes the mob leap/pounce at its target.
breedAllows the mob to breed.
panicRuns around frantically when set on fire.
creeperswell / creeperexplodeCreeper-specific explosion countdown behavior.
rangedattack / arrowattackBasic ranged projectile attack.
bowattack / bowshoot / bowmasterAdvanced skeleton-style bow attack behavior.
crossbowattackCrossbow ranged attack behavior.

Custom AI Goals

These goals are implemented directly by the plugin and can be configured with arguments:

1. gotolocation (or goto)

Forces the mob to pathfind to a specific location coordinate:

  • Format: gotolocation <x>,<y>,<z>[,speed]
  • Example: 1 gotolocation 100,64,100,1.2

2. gotoowner

Instructs the mob to pathfind to its owner when it wanders further than a threshold:

  • Format: gotoowner [minDistance] [speed]
  • Example: 1 gotoowner 5 1.0 (Defaults to 5 blocks distance minimum)

3. patrol (or patrolroute)

Sets up a sequential path for the mob to patrol between multiple coordinates:

  • Format: patrol <x1>,<y1>,<z1>;<x2>,<y2>,<z2>;...
  • Example: 1 patrol 10,64,10;20,64,20;30,64,10

4. fleeplayers (or runfromplayers)

Forces the mob to run away from nearby players within a specified radius:

  • Format: fleeplayers [radius] [speed]
  • Example: 1 fleeplayers 12 1.3

5. donothing

Halts all pathfinding, targeting, and movement behaviors for the mob:

  • Format: donothing
  • Example: 0 donothing

Target Selectors

Target Selectors determine what entities a mob will try to target and attack. They are defined under the AITargetSelectors configuration list:

{
name: "Patrol Guard",
type: "ZOMBIE",
health: 40,
options: {
AITargetSelectors: [
"0 clear",
"1 players 16",
"2 hurtbytarget"
]
}
}

Supported AI Targets

Target Name / AliasDescription
clearClears all target selectors from the mob.
hurtbytarget / attacker / damagerTargets whichever entity attacks this mob.
players / playerTargets players within a specific radius.
Format: players [radius] (Defaults to 16 blocks)
villagers / villagerTargets villagers within a specific radius.
Format: villagers [radius] (Defaults to 16 blocks)
irongolem / iron_golems / iron_golemTargets iron golems within a specific radius.
Format: irongolem [radius] (Defaults to 16 blocks)
monsters / monsterTargets monsters/hostile entities within a specific radius.
Format: monsters [radius] (Defaults to 16 blocks)
ownerattacker / ownerhurtby / ownerdamagerTargets whichever entity attacks this mob's owner.
ownertarget / ownerattack / ownerhurtTargets whichever entity this mob's owner is currently targeting or attacking.
parenthurtby / parentdamager / parentattackerTargets whichever entity attacks this mob's parent.
parenttarget / parenthurt / parentattackTargets whichever entity this mob's parent is currently targeting or attacking.