[Fixed] Custom Mobs Attacking Each Other

Started by RoAmbros on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Fixed] Custom Mobs Attacking Each Other

I created a custom mob that I wanted to attack Monsters but it started attacking other custom mobs that were supposed to be its ally. I was finally able to implement a fix after piecing it together from other forum posts.

Basically, I put a custom item into the custom mobs' armor slots (head for this example) and then had it check for that item in that slot. If it found the item, it prevented the attack. If the item was missing, it proceeded to attack.

 

This example is of a stationary mob that only does ranged attacks (i.e. a turret). 

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I did something like that,…
Sat, 11/25/2023 - 01:35

I did something like that, and although my custom mobs don't run towards each other anymore, they still occasionally harm each other. What should I do? (2023.3)

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In other words, they don't…
Sat, 11/25/2023 - 01:35

In other words, they don't ignore each other entirely.