Make a mob prioritize attack?

Started by NackMache on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make a mob prioritize attack?

I'm just curious is there any way to make mob prioritize their attack on one mob over another?

For example, it's chasing a player and suddenly changes to attack a villager when it sees one.

I've looked around the forums but don't find anything close to this. It would be awesome if we can do that

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The mob AI procedure start…
Sun, 11/27/2022 - 23:49

The mob AI procedure start block says "Blocks higher on the list have a higher priority"

This means if you put an attack entities of type villager above attack entities of type player, the mob will attack nearby villagers if there are, otherwise attack nearby players, if there are players nearby. (Of course this depends on the two conditions on the block (and whether you have them ticked), "nearby only" and "in sight only")

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you! That makes a lot…
Sat, 01/07/2023 - 09:28

Thank you! That makes a lot of sense