how to make a mob aggressive at half health

Started by EJwolfyXD on

Topic category: Help with modding (Java Edition)

Last seen on 18:00, 26. Jun 2023
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how to make a mob aggressive at half health

Hello, I am very new to this forum and VERY new to modding. I am trying to make a mob that only aggro's at half health. I am unsure of how to start making a condition do this :( could anyone help?

Last seen on 05:57, 3. Nov 2023
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi! There is a Entity Health…
Wed, 11/23/2022 - 18:21

Hi!

There is a Entity Health variable and a Entity Max Health variable, i think you can do a condition with : 

return Entity health < (Max Entity Health  /2)