Limiting entities a tamed mob can attack

Started by ShadowPlayer51 on

Topic category: Help with modding (Java Edition)

Last seen on 19:43, 19. Apr 2024
Joined Nov 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Limiting entities a tamed mob can attack

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?