AI Goal Selectors broken for some mobs
Closed
AI Goal Selectors broken for some mobs
AI Goal Selectors doesn't work for some mobs. Using only clear fastest testing method.
If meleeattack goal is used in one of the mobs that are broken, the mob stops after a certain period of time if the player does not move at all and does nothing until the player moves. Example video for this behavior: https://www.youtube.com/watch?v=4eXlndiBI7E
AIGoalSelectors:
- clear
Working mobs: blaze, creeper, drowned, endermite, evoker, ghast, husk, magma_cube, pillager, ravager, shulker, silverfish, slime, vex, vindicator, witch, zombie, zombie_villager, bee, cave_spider, enderman, iron_golem, llama, panda, polar_bear, spider, wolf, zombified_piglin
Not working mobs: elder_guardian, guardian, hoglin, phantom, piglin_brute, skeleton, stray, wither_skeleton, goat, zoglin, piglin,
Many mobs are unimportant, but can you fix the skeleton family?
Tested with 1.18.2 Purpur and MythicMobs-5.1.4
Edit more info: Use meleeattack on zombies make zombie freezee issue same as video.
AIGoalSelectors:
- clear
- meleeattack
Similar bug: FollowRange and ThreatTable can't be used same time. Mobs are freeze 1 second when entering FollowRange and start walking after.
Example for this:
test_1: Type: ZOMBIE Health: 1000 Damage: 1 Faction: test AIGoalSelectors: - clear - meleeattack - randomstroll - randomlookaround AITargetSelectors: - clear - players Options: Silent: true Despawn: true FollowRange: 5 PreventOtherDrops: true PreventItemPickup: true KnockbackResistance: 1.0 PreventMobKillDrops: true NoDamageTicks: 1 Modules: ThreatTable: true
Edited by Taneradded Discussion label
After debugging for hours finally found the what is triggering this bugs.
Skeleton: If skeleton have bow in hand clear working. If skeleton have anything except bow in any of the hands clear stopped working. Even give sword 3 sec delay is same. When the mob get the sword starting the fight. Mob rewrite its own Ai Goal table when get anything in hands. PreventRandomEquipment: true is trigger this bug because mob spawn without bow if Equipment is not set as bow.
Wither Skeleton: Same rules apply but any sword.
Stray: Same as Skeleton
Triggering this bug and use - meleeattack same time trigger freezing mob bug. meleeattack should not be used if first bug trigger.
About ThreatTable
PLEASE do not fix like that. This will completely break ThreatTable mobs. Let me explain. We are using FollowRange as mob aggro to player. ThreatTable mobs doesn't have settings lose aggro to player except ThreatTable rules. ThreatTable mobs should never lose aggro to player except ThreatTable rules, spawner leash reset. If you make ThreatTable obeying FollowRange this will break all mobs because lose aggro will obey this to. Mobs will stop when player go out FollowRange same as non-ThreatTable mobs. ThreatTable is completely meaningless in this case.
If you split lose aggro from FollowRange and add new settings to ThreadTable options will be nice solution. Or just fix the freezing issue ? If not please do no make TT obeying follow range, leave like this. If we not set Follow range leave as mob default not trigger this freeze bug.
More info about AI Goal
When adding 5 tick delay clear is working.
- runaigoalselector{goal=clear;delay=5} @self ~onSpawn
Adding meleeattack always broke mob ai (freezee not attacking mob bug)
- runaigoalselector{goal=meleeattack;delay=20} @self ~onSpawn
Only solution for now never use meleeattack if mob using anything other than bow because mob add itself this goal auto. When we add meleeattack to mob will have 2x meleeattack and they cancel each other/make mob freezee. This is my best guess cause of this bug.
If this is minecraft limitation and cannot be fixed add warning in the wiki will be nice for other users.
Edit: After more testing: Any of usage of AIGoal break the mob ai fully(even delayed clear and add another ai goal ). Mob will stuck between meleeattack and other aigoals.
- runaigoalselector{goal=clear;delay=5} @self ~onSpawn - runaigoalselector{goal=randomlookaround;delay=7} @self ~onSpawn - equip{item=sword_one:5;delay=10} @self ~onSpawn
Using like this make mob stuck between meleeattack and randomlookaround while fighting players. https://www.youtube.com/watch?v=qBFmv4XH1rM
Edited by TanerI haven't had any luck replicating this. The following config works as intended:
TestAISkeletonMelee: Type: SKELETON Display: Skeleton Melee Test Equipment: - iron_sword HAND AIGoalSelectors: - clear - meleeattack - randomstroll AITargetSelectors: - clear - players
The skeleton will attack me with its sword, or randomly walk around if not in combat.
To be comprehensive I also tested this:
WeaponSwapTest: Type: SKELETON Display: 'Testing Dummy' Equipment: - iron_sword HAND AIGoalSelectors: - clear - 1 meleeattack AITargetSelectors: - clear - players Skills: - skill{cooldown=16;s=[ - equip{item="bow HAND"} - runaigoalselector{goal=clear} - runaigoalselector{goal=1 bowmaster} - delay 160 - equip{i="iron_sword HAND"} - runaigoalselector{goal=clear} - runaigoalselector{goal=1 meleeattack} ]} @self ~onTimer:20 ?incombat
This mob will swap back and forth between using melee and ranged attacks as expected, and if I throw in other goals they seem to work fine
I tested your first config my local and another user online server both are same. Mob is freezing and attack speed is so slow if you do not touch to keyboard.
My Local server Stable 5.2 version: https://www.youtube.com/watch?v=LFG_TawnsXs
Another user server(MM is One of the 5.2 dev version): https://www.youtube.com/watch?v=jd5RVJEjfHk
Edited by TanerSince Skeleton is problematic, I thought of replacing it with Piglin, but that is also problematic.
-
Can't clear AI goal or add any default goals. Mechanic doesn't work either. Add custom MM Goal working (fleeConditional)
-
Can't clear or add target to AITargetSelectors. Add custom MM Target Not working (SpecificFaction my_faction_name)
Piglin is AI hardcoded mob ?
TestAIPiglinMelee: Type: Piglin Display: Piglin Melee Test Equipment: - iron_sword HAND AIGoalSelectors: - clear #- meleeattack #- randomstroll AITargetSelectors: - clear #- players
-
added Completed / Resolved label