entities of same type cant hurt each other

Started by FlyingCatOfLol on Mon, 07/19/2021 - 15:53

Topic category: Help with modding (Java Edition)

Last seen on 23:48, 6. Aug 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
entities of same type cant hurt each other
Mon, 07/19/2021 - 15:53

i have a villager with a crossbow, and everytime they shoot and miss and hit another villager with a crossbow, they shoot each other, which i do not want. Is there a way to avoid this like how pillagers shoot each other and dont care?

Last seen on 21:42, 22. Sep 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Yup, you can cancel event of…
Thu, 07/22/2021 - 20:23

Yup, you can cancel event of being hurt, setting them like that:

friendly-fire

It's mechanics for my own mod, but you get the idea. Of course if you have only one type of mob, you just need one "source entity" and one "event/target entity", but I used it widely for whole added nation.