Issues with a custom 'Guard'-esc AI (SOLVED, IF YOU HAVE THIS ISSUE CHECK FOR MY SOLUTION)

Started by MagyTheMage on

Topic category: Help with MCreator software

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Issues with a custom 'Guard'-esc AI (SOLVED, IF YOU HAVE THIS ISSUE CHECK FOR MY SOLUTION)
Tue, 03/24/2020 - 01:18 (edited)

Hi, Ive reciently downloaded McCreator and beeing trying to make a new Mod, However, ive reached to a standstill:

 

I created a new mob, i wanted this mob to act as a guard of sorts, however im struggling to make its AI work,

 

In order to set it to attack, i have to set it as "mob" type (creature type mobs wont attack, i supose this is intended) , So i went to its AI routines and tride to set it to attack "EntityMob" However, i quickly figured out that this would lead to the mob attacking itself, since its a "mob", i tried to use "EntityMob" so that this mob would also intreact and attack entities from other mods that i was planning to install this with, Im trying to figure out a way arround this, but i cant think of any.

 

Apparently setting it to "Iron Golem" Base AI means that it will work as i would technically intend to,  but i dont really want them to be launching mobs up like an iron golem would, and it also breaks the attacking animation, Ive also tried using the "avoid entity" but that just causes them to run like headless chickens and not attack their intended target, 

 

Is there any way to get this to work? ive ran out of ideas, unless there is some sort of way i can edit the base "iron golem" ai that comes with McCreator, i dont know if there is a way to do what i intend to, 

 

and yeah i know that i can technically set a long list of mobs taht i want it to attack but that only includes the vanilla ones,.

 

 

EDIT:

Ive found a way to solve it! i will leave it written down in here just in case anyone else ever has this issue:

- Set your AI as Mob
- Set your AI to attack Entity:Mob
- Normally this would result in the entity attacking other entities of the same type

 

However with the following procedure:

 

- Create a new procedure

- Edit the block  "Event trigger", on the dropdown menu, select something like: Player joins world (thats what i selected, using mod loaded didnt seem to work) 

- Under world mangment use the "Execute command" , and type in /execute @p ~ ~ ~ scoreboard teams add TeamName TeamName  (This is creating a team)

- Next time you summon one of your entities, summon them with the command /execute @p ~~ ~ summon modname:entityname ~ ~1 ~ {Team:TeamName}

If everything went correctly, all your entities should be on the team "TeamName" and thus never attack eachother even if the AI tells them to do so!

 

This is so far the only way i figured out to make this work, 

 

Edited by MagyTheMage on Tue, 03/24/2020 - 01:18
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
EntityMonster will solve all…
Sun, 03/22/2020 - 06:27

EntityMonster will solve all your problems

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh there was an entity…
Sun, 03/22/2020 - 15:22

Oh there was an entity monster? i was looking for that but i didnt see it so i thought it didnt exist lol

 

thank you

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry for the double post (i…
Sun, 03/22/2020 - 15:31

Sorry for the double post (i literally dont see any edit button) but..i cant really find entitymonster? am i doing something wrong here?

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah...but like i said the…
Mon, 03/23/2020 - 03:06

Yeah...but like i said the issue is that to make my Mob actually attack i have to set it to be a Mob

 

so telling it to attack entitymob means that it will attack itself..

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just for clarification, with…
Mon, 03/23/2020 - 03:11

Just for clarification, with itself i mean attack mobs of the same type, id edit this in but im kinda confused on if there is no edit button or im just not seeing it

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
EDIT: Ive found a way to…
Tue, 03/24/2020 - 01:17

EDIT:

Ive found a way to solve it! i will leave it written down in here just in case anyone else ever has this issue:

- Set your AI as Mob
- Set your AI to attack Entity:Mob
- Normally this would result in the entity attacking other entities of the same type

 

However with the following procedure:

 

- Create a new procedure

- Edit the block  "Event trigger", on the dropdown menu, select something like: Player joins world (thats what i selected, using mod loaded didnt seem to work) 

- Under world mangment use the "Execute command" , and type in /execute @p ~ ~ ~ scoreboard teams add TeamName TeamName  (This is creating a team)

- Next time you summon one of your entities, summon them with the command /execute @p ~~ ~ summon modname:entityname ~ ~1 ~ {Team:TeamName}

If everything went correctly, all your entities should be on the team "TeamName" and thus never attack eachother even if the AI tells them to do so!

 

This is so far the only way i figured out to make this work, 

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
God bless you with this…
Tue, 03/24/2020 - 09:51

God bless you with this temporary workaround, I had a similar issue as well