Mob AI Commands Mod
This mod represents a standalone version of commands from the Mob AI Tweaks modification, created specifically for datapack developers who wanted similar functionality exclusively on the server side.
Core Commands
/attack — forces one mob to attack another. Perfectly combines with /execute for full behavioral control of entities.
Practical usage examples:
/attack @n[type=husk] fake_melee— makes a husk perform attack animation without dealing damage/attack @n[type=drowned] @n[type=bogged] with_melee— a drowned attacks a bogged entity in close combat/attack @n[type=skeleton] @p from_range— skeleton performs standard ranged attack (arrow shooting) at the nearest player/attack @n[type=zombie] @r custom_projectile minecraft:arrow 1 20 {crit:1b}— zombie shoots an arrow at a random entity with appropriate speed and configuration settings
/motion — management of vector movement speed for mobs:
/motion @p 0 1 0 add— adds unit increment to vertical velocity/motion @p 0 1 0 set— sets specific speed values along axes/motion @p ~ 1 ~ set— modifies only the vertical movement component/motion @p 0 ~ 1 set true— similar to previous, with rotation according to facing direction/motion @p 0.5 ~ 0.5 multiply— scales horizontal components of velocity vector
/pathto — forced pathfinding control for entities:
/pathto @n[type=zombie] 0 0 0— zombie moves toward world spawn point/pathto @n[type=zombie] ~10 ~ ~ 2.0— zombie moves 10 blocks forward with double speed/pathto @n[type=zombie] 0 0 0 2.0 10— similar to first, but with minimum 10-block distance from target/pathto @n[type=zombie] @p— group of zombies follows the nearest player- variations of speed and following mechanism distance parameters
/target — assignment of attack targets between mobs:
/target @n[type=blaze] @n[type=breeze]— blaze attacks breeze entity
Additional feature — the mod adds the /rotate command to earlier versions, first introduced in version 1.21.2.