|
|
This page includes all the AI Goal and Target Selectors for your mobs. It allows you to change the behavior and functionality.
|
|
|
|
|
|
**AI Goal Selectors**
|
|
|
---
|
|
|
### Goal Selectors
|
|
|
|
|
|
Goal Selectors are used with the AIGoalSelectors field and determine what mobs want to “do”. Certain custom goals might not work if they're not included in the base AI of the mob you're creating. For example, a zombie won't be able to use the AI goal “EatGrass”, because a zombie would never use that goal in the first place. Feel free to experiment however!
|
|
|
Goal Selectors are used with the AIGoalSelectors field and determine what mobs want to “do”. Certain custom goals might not work if they're not included in the base AI of the mob you're creating. For example, a zombie won't be able to use the AI goal “EatGrass” because a zombie would never use that goal in the first place. Feel free to experiment to figure out what does and doesn't work!
|
|
|
|
|
|
**You also cannot cause a passive mob to attack a target as the event is not handled and will crash the server.**
|
|
|
Note: Certain goals will not work correctly if the world is in peaceful mode.
|
|
|
|
|
|
Example:
|
|
|
|
|
|
---
|
|
|
**Example:**
|
|
|
```
|
|
|
ZombieAIMob:
|
|
|
Type: ZOMBIE
|
|
|
Health: 125
|
|
|
Display: 'Custom AI Zombie'
|
|
|
SuperMob:
|
|
|
Type: zombie
|
|
|
Health: 200
|
|
|
Display: 'Superb Zombie'
|
|
|
AIGoalSelectors:
|
|
|
- 0 clear
|
|
|
- 1 meleeattack
|
|
|
- 2 randomstroll
|
|
|
- clear
|
|
|
- meleeattack
|
|
|
- randomstroll
|
|
|
```
|
|
|
|
|
|
**Breaking down the example:**
|
|
|
This zombie would attack players, and walk around randomly when not targeting an enemy.
|
|
|
|
|
|
**All Mobs**
|
|
|
|
|
|
| AI Goal | Aliases | Description |
|
|
|
| ------------- | ---------------- | ----------------------------------------------------- |
|
|
|
| clear | reset | Removes the AI from the mob |
|
|
|
| breakdoors | | Causes the mob to break down doors it runs into |
|
|
|
| eatgrass | | Makes the mob occasionally… eat grass |
|
|
|
| float | swim | Makes the mob swim in water/not sink |
|
|
|
| lookatplayers | | The mob will look at nearby players |
|
|
|
| opendoors | opendoor | The mob will open doors it runs into and close the door behind it |
|
|
|
| closedoors | restrictopendoor | Not sure what this one does |
|
|
|
| randomlookaround | lookaround | The mob will randomly look around |
|
|
|
| gotospawnlocation | gotospawn | Mob will pathfind to the its spawn location |
|
|
|
| fleeConditional **[Premium-only]** | fleeIf | Causes the mob to flee based on provided conditions. Safe speed is required for distanes greater than 5. |
|
|
|
| doNothing **[Premium-only]** | | Causes the mob to do nothing if conditions are met. |
|
|
|
|
|
|
FleeConditional Example:
|
|
|
```
|
|
|
- 0 clear [Clears the mob AI, will be explained down below]
|
|
|
- 1 meleeattack [Tells your mob to use a melee attack against its targets]
|
|
|
- 2 randomstroll [Tells your mob to wander around]
|
|
|
AIGoalSelectors:
|
|
|
- clear
|
|
|
- fleeConditional{distance=5;speed=2;safespeed=2;conditions=[ - inlineofsight true ]}
|
|
|
```
|
|
|
The order 0 - 1 - 2 is made to set priority over some AI Goals, by putting meleeattack at 1 and randomstroll at 2, the mob will priorize melee attacking its targets than randomly wandering around. Experiment with it!
|
|
|
|
|
|
**Creatures Only**
|
|
|
|
|
|
| AI Goal | Aliases | Description |
|
|
|
| ------------- | ---------------- | ----------------------------------------------------- |
|
|
|
| avoidcreepers | | Causes the mob to avoid Creepers |
|
|
|
| avoidskeletons | | Causes the mob to avoid Skeletons |
|
|
|
| avoidzombies | | Causes the mob to avoid Zombies |
|
|
|
| fleesun | | The mob will hide in the shade when the sun it out |
|
|
|
| meleeattack | | Causes the mob to move to and melee-attack its target |
|
|
|
| movetowardstarget | | Causes the mob to move towards its target |
|
|
|
| randomstroll | | The mob will randomly walk around |
|
|
|
| restrictsun | | In theory this will keep the mob from entering sunlight |
|
|
|
| fleeplayers | runfromplayers | Causes the mob to avoid Players |
|
|
|
| fleegolems | runfromgolems | Causes the mob to avoid Iron Golems |
|
|
|
| fleevillagers | runfromvillagers | Causes the mob to avoid villagers |
|
|
|
| fleewolves | runfromwolves | Causes the mob to avoid wolves |
|
|
|
| fleefaction | runfromfaction | Causes the mob to avoid entities in a given faction |
|
|
|
| spiderattack | | Uses the attack a spider would (doesn't seem any different from a meleeattack) |
|
|
|
| leapattarget | | Makes the mob leap at its target |
|
|
|
| moveindoors | | |
|
|
|
| movethroughvillage | | |
|
|
|
| movetowardsrestriction | | |
|
|
|
| patrol x1,y1,z1;x2,y2,z2;x3,y3,z3;… | patrolroute | Makes the mob patrol between the specified locations |
|
|
|
| gotolocation x,y,z | goto | Makes the mob go to the specified location(Notice Followrange must more than the distance between location and mob) |
|
|
|
| gotoowner # | | Makes the mob move towards its owner when beyond a certain distance (defaults to 5 blocks,Notice Followrange must more than the distance between location and mob) |
|
|
|
| gotoparent | | Makes the mob move towards its parent mob |
|
|
|
| panicWhenOnFire | panic | Run around panicking when on fire and look for water
|
|
|
| randomFly | | Fly around randomly |
|
|
|
|
|
|
**Ranged Entities Only**
|
|
|
|
|
|
| AI Goal | Aliases | Description |
|
|
|
| ----------------- | ----------------------- | ----------------------------------------------------- |
|
|
|
| arrowattack | | Projectile attack (shooting a bow for a skeleton) |
|
|
|
| skeletonbowattack | bowshoot, bowmaster | Draw the bow and shoot the arrow |
|
|
|
|
|
|
**Piglins and Pillagers Only**
|
|
|
|
|
|
| AI Goal | Aliases | Description |
|
|
|
| ------------- | ---------------- | ----------------------------------------------------- |
|
|
|
| crossbowAttack | | attack with a crossbow |
|
|
|
|
|
|
**Target Selectors**
|
|
|
---
|
|
|
Target Selectors are used with the AITargetSelectors field and determine what mobs try to target.
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
SuperMob:
|
|
|
Type: zombie
|
|
|
Health: 200
|
|
|
Display: 'Superb Zombie'
|
|
|
AIGoalSelectors:
|
|
|
- clear
|
|
|
- meleeattack
|
|
|
- randomstroll
|
|
|
AITargetSelectors:
|
|
|
- clear
|
|
|
- players
|
|
|
- golems
|
|
|
```
|
|
|
|
|
|
**All Creatures**
|
|
|
|
|
|
### Mobs - Goal and Target
|
|
|
| AI Goal | Aliases | Description |
|
|
|
| ------------- | ---------------- | ----------------------------------------------------- |
|
|
|
| clear | | Special Option. Clears all of the mob's AI. |
|
|
|
| attacker | hurtbytarget, damager | Targets whatever attacks the mob |
|
|
|
| monsters | | Targets monsters. |
|
|
|
| players | | Targets players. |
|
|
|
| villagers | | Targets villagers. |
|
|
|
| golems | | Targets Golems. |
|
|
|
| nearestConditionalTarget **[Premium-only]** | nearestConditional, nearestIf | Targets the nearest entity that meets the conditions provided. |
|
|
|
|
|
|
NearestConditionalTarget Example:
|
|
|
```
|
|
|
AITargetSelectors:
|
|
|
- clear
|
|
|
- nearestConditionalTarget{conditions=[
|
|
|
- entitytype PLAYER true
|
|
|
- hasaura{aura=marked_for_death} true
|
|
|
]}
|
|
|
```
|
|
|
|
|
|
**All Creatures(Faction Support)**
|
|
|
|
|
|
| AI Goal | Description |
|
|
|
| ------------- | ----------------------------------------------------- |
|
|
|
| OtherFaction | Targets ANY entities that are in a different faction. |
|
|
|
| OtherFactionMonsters | Targets any monsters that are in a different faction. |
|
|
|
| OtherFactionVillagers | Targets any villagers that are in a different faction. |
|
|
|
| SpecificFaction [faction_name] | Targets any entities that are in the given faction. |
|
|
|
| SpecificFactionMonsters [faction_name] | Targets any monsters that are in the given faction. |
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
AITargetSelectors:
|
|
|
- SpecificFaction undead
|
|
|
```
|
|
|
|
|
|
**Goal: All Mobs**
|
|
|
This will force a mob to attack mobs only in the “undead” faction.
|
|
|
|
|
|
| AI Goal | Alias | Description |
|
|
|
| ------- | ------ | ----------- |
|
|
|
| clear | reset | Removes the AI from the mob. Useful to build custom mobs behavior. |
|
|
|
| breakdoors | | Causes the mob to break down doors it runs into. |
|
|
|
| eatgrass | | Makes the mob occasionally eat grass. |
|
|
|
| float | swim | Allows the mob to float in water, without this, mobs sink. |
|
|
|
| lookatplayers | | The mob will look at nearby players. |
|
|
|
| opendoors | opendoor | Allows the mob to open doors they come across. |
|
|
|
| closedoors | restrictopendoor | **Not tested yet.** |
|
|
|
| randomlookaround | lookaround | Will cause the mob to randomly look around. |
|
|
|
**Tameable Creatures**
|
|
|
|
|
|
**Target:** |
|
|
| AI Goal | Description |
|
|
|
| ------------- | ----------------------------------------------------- |
|
|
|
| ownerattacker | Targets whatever attacks the mob's owner. |
|
|
|
| ownertarget | Targets whatever the mob's owner attacks. | |
|
|
\ No newline at end of file |