Limiting entities a tamed mob can attack

Started by ShadowPlayer51 on Wed, 07/21/2021 - 20:42

Topic category: Help with modding (Java Edition)

Last seen on 05:52, 22. Nov 2022
Joined Nov 2015

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Limiting entities a tamed mob can attack
Wed, 07/21/2021 - 20:42

I've been working with tamed entities recently, and I was trying to make it so that they wouldn't hurt other entities that the player has tamed. The problem is that conditions for when a mob will attack what its owner attacked seem to only be able to grab info about itself. No matter what I use, (source entity, immediate source entity, entity iterator [even though that one wouldn't make sense]), only event/target entity works and they will still attack other tamed mobs.

Is there any way I can make a tamed mob not attack certain entities or, at least, entities that the player has tamed?