Entity Indicating Armored Player is Hostile

Started by JD_Plays73 on Thu, 08/13/2020 - 16:58

Topic category: Help with modding (Java Edition)

Last seen on 00:55, 23. Aug 2020
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Entity Indicating Armored Player is Hostile
Thu, 08/13/2020 - 16:58

 Hi! I've been trying to deal with procedures and conditioning for a little bit now, as I've been getting the hang of it. But there's just one thing I really want, which is whenever a player wears a type of armor, an entity will identify the player wearing armor and proceed to attack said player. My problem with that is I'm not entirely sure how I could have the detecting part of the condition work. I've made a procedure act like a condition for the entity, but I'm not sure why it won't work.

This is what I tried to do for the procedure (note, I still barely understand the logistics of coding and this kind of stuff, so do bear in mind):

https://imgur.com/a/HbYSrHg

Procedure for Armor Detection

Last seen on 16:48, 17. Dec 2020
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
in the AI, you can have it…
Thu, 08/13/2020 - 17:08

in the AI, you can have it attack players.
Add a condition to the AI block with a procedure that returns true if the player has a type of armor.
That should do the trick.

Last seen on 16:48, 17. Dec 2020
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Correction: Your return…
Thu, 08/13/2020 - 17:11

Correction: Your return function works.
The problem is probably with the AI's condition weirdness. I tend to circumvent this by having the condition be in both the starting and continuous condition fields.
 

Last seen on 00:55, 23. Aug 2020
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I have done that beforehand,…
Thu, 08/13/2020 - 19:17

I have done that beforehand, but still nothing had changed. Give me a moment to do it again...

Alright, so they still didn't detect the armor... Maybe it's the components/logic I used? Or the entity AI Tasks?