Entity attacks itself even when entity iterator excludes it

Started by Minecraft Mathers on

Topic category: Troubleshooting, bugs, and solutions

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Entity attacks itself even when entity iterator excludes it

So, i'm making an effect called "Taunt" which makes all neutral/aggressive monster entities attack whoever has the Taunt effect... except, it also makes the entity WITH the effect attack ITSELF. Here's the procedure, under TauntOnEffectActiveTick:

 

For each entity as [Entity iterator] at x y z in square cube size of 7 Do:

If: Not is [entity iterator] (sub)type of player OR server player, AND not is [entity iterator] the same entity as [Event/target entity], AND is [entity iterator] (sub)type of monster entity

Do: Set the attack target of [entity iterator] to [event/target entity]

 

Anyone knows how to fix this? Thx in advance. :3

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can I get a screenshot of…
Sun, 03/15/2026 - 13:08

Can I get a screenshot of the procedure? The text is a little confusing. I think you might’ve messed up a Event Target Entity vs Entity Iterator somewhere and that’s why, but I could just be confused. 

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Maybe the Set Attack Target…
Sun, 03/15/2026 - 22:27

Maybe the Set Attack Target of Entity is just an override block, so if there ends up being no target, it just picks one outside of your procedure. I don’t know for sure, I haven’t really played around with entities,