How do I make my mob attack certain groups of mobs?

Started by DevinTank123145 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make my mob attack certain groups of mobs?

I want my entity to attack a certain mob group like undead, illagers, or arthropods but I dont know how too. 

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can either make a…
Fri, 11/17/2023 - 23:54

You can either make a procedure that  checks for entities of that type within a radius, and sets the entity's attack target to the nearest one; or you can just specify each individual entity as a target in the Mob AI. (Which may be quicker, depending on how many different types of entities you want it to target.) You would just add an 'attack entities of type' AI function in addition to the melee attack function.

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mindthemoods  how would you…
Wed, 08/14/2024 - 21:26

Mindthemoods  how would you do this? does it require custom code?