Started by
BryAstro
on
Topic category: Help with Minecraft modding (Java Edition)
First, make sure you put a "Do attack" block a "Fight attacker mobs back" block so your desired mob can attack and fight back.
Next, make sure you have this as your entity tick update procedure:

Alternatively, you could replace the entity tags block with the (sub)type block if you only want the entity to spare its own kind exclusively.
Credits to https://www.youtube.com/@gibbhartin643 for giving me the framework (Gibb didn't make a video tutorial but since Gibb told me the procedure I thought it would be nice to give some credit), I've only made a few modifications to the framework to fix any issues that were present.
Edited by BryAstro on Fri, 04/17/2026 - 05:19
Nice solution, thanks for sharing!