Started by
Greenhead
on
Topic category: Help with Minecraft modding (Java Edition)
Hi, im making a mod that adds terraria-like summons. How do i make so it follows the player and attacks other mobs?
Topic category: Help with Minecraft modding (Java Edition)
Hi, im making a mod that adds terraria-like summons. How do i make so it follows the player and attacks other mobs?
Use the look at nearest (Player) task.
Add attack entity task.
Lock the code and replace
this.targetSelector.addGoal(5, new NearestAttackableTargetGoal(this, ZombieEntity.class, true, false));
With:
this.targetSelector.addGoal(5, new NearestAttackableTargetGoal(this, MonsterEntity.class, true, false));
This will make the mob attack monster entities.
Note the '5' is the tasks order so whatever number was there when you edited the code you should replace the 5 with.
I noticed that EntityMonster was in the procedure menu but not the AI task menu.
Thank you!
It doesent attack mods or i think it didnt save the code? How to fix this