entities of same type cant hurt each other

Started by FlyingCatOfLol on

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:
  • MCreator plugins:
  • Comments:
entities of same type cant hurt each other

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?

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.