Get entity target for attack

Started by U.S.S.DEFIANT on

Topic category: Help with modding (Java Edition)

Last seen on 18:32, 25. Apr 2024
Joined Dec 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Get entity target for attack

Good evening.

I want to make a procedure for mob AI: if player have some effects, attack him. How can I get the target, that mob want to attack? I tried to use: Get Entity (Event/target entity) is targeting for attack, but it returned null. How can I fix it?

Last seen on 14:52, 19. Mar 2023
Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
same
Sun, 09/05/2021 - 15:25

same

Last seen on 12:18, 13. Apr 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Any idea about this?
Thu, 04/04/2024 - 15:36

Any idea about this?

Last seen on 23:17, 26. Apr 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The returning null error for…
Thu, 04/04/2024 - 15:45

The returning null error for the 'Get Entity (Event/target entity) is targeting for attack' can be bypassed by putting it in an if block that checks is Get Entity (Event/target entity) is targeting for attack (sub)type of LivingEntity. I don't know why, but it works without crashing.