How do I make events determined according to the mob's health drops in Mcreator ?

Started by GyokuroKunso on

Topic category: Help with MCreator software

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make events determined according to the mob's health drops in Mcreator ?

Guys, I'm a beginner with Mcreator and I wanted to know how I can do certain events as the mob's health drops in Mcreator? I would be very grateful if someone could explain and show an example of the code in an image

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It really depends on what…
Fri, 10/20/2023 - 20:31

It really depends on what specifically you want to do, but I'm willing to provide examples. 

Generally speaking, you'll want to create a procedure with the 'before entity is hurt' global trigger. (Whenever an entity takes damage, your procedure will trigger on the same tick, before the damage is dealt.) You can then use the 'current health' function in the entity data tab to check the current health of the entity, and if you wanted to, you could divide this by the 'maximum health' of the entity and multiply by 100 to get a percentage value. (This way you could make a procedure that, for example, triggers whenever an entity falls below 50% health, regardless of what their maximum health is. 

But there's a lot of stuff you could do with this. What did you have in mind?

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I wanted him to do certain…
Fri, 10/27/2023 - 17:46

I wanted him to do certain types of attacks, for example attacking from far away, summoning servants and other types of movements that could be done

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
...That could be more…
Fri, 10/27/2023 - 18:36

...That could be more difficult. You could try coding in different attack behaviors with conditions based on the mob's health, but if you want seriously different texture/model/behavior for lower health, (like for a bossfight), you might be better off just spawning in another version of the entity and despawning the old one whenever the health falls below a certain point. Making behavioral changes to a single entity is kind of limited.

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay , thank you bro
Fri, 10/27/2023 - 18:53

Okay , thank you bro