Help Me Guys With Mob Attacking Everything Except Entities From The Tag

Started by Adamooooos07 on

Topic category: Help with modding (Java Edition)

Last seen on 22:57, 25. Feb 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help Me Guys With Mob Attacking Everything Except Entities From The Tag

Hi Guys So Im Trying To Make An Infection Like Mod, So A Mob Will Attack Every Living Entity Except Entities From The Selected Tag Here's How I Made This(Every Time The Mob Tries To Target Something It Will Crash The Game And When I Change To Any Other Procedure It Just Doesn't Work, And Also The Sub Types Don't Work To) Sorry I Don't Have Images And I Don't Know How To Upload Via URLS:

Entity AI And Goals:

       -Attack Enities Of Type Living Entity. Conditions:

                            -AttackNonEyeCreatures Condition - Additional Starting Condition And Additional Continuing Condition

      -AttackNonEyeCreatures Procedure:

                   -Return Not Is Get Entity Event/Target Entity Is Targeting for attack tagged as "eye_attack:eye_army"(the mod name is eye_attack and the tag id is eye_army)

Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For a behavior like this,…
Wed, 11/08/2023 - 16:45

For a behavior like this, you probably don't want to do this using AI, you want to make a custom procedure that runs on entity update tick.

In the procedure, use an 'entity iterator' bracket to get all the entities in a desired radius. (Anything inside the bracket that refers to 'entity iterator' instead of 'event/target entity' will target each individual entity in the radius, instead of the entity calling the procedure.)

Inside the entity iterator bracket, first check if the entity iterator is not tagged in your custom tag. If it is not, use the 'set attack target' function to set the attack target of the event/target entity, (NOT the entity iterator), to the entity iterator. 

You might need to add some additional variables and math to specifically target the nearest entity, but this should be enough for most purposes.

Last seen on 15:15, 13. May 2024
Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hey! i'm pretty new to…
Mon, 05/13/2024 - 14:48

hey! i'm pretty new to mcreator and i'm stuck with the same issue, can you send a picture of the procedure?