Procedure help: Replacing one entity with another at certain HP

Started by Kyuumulo on

Topic category: Help with modding (Java Edition)

Last seen on 19:41, 2. Jul 2023
Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedure help: Replacing one entity with another at certain HP

Essentially, what I'm trying to do is have my goofy goober of a boss get replaced with a "phase 2" once he reaches half health. I've been fiddling around with the blocks for well over 30 minutes and have made a grand total of... no progress! So if anyone could help me out with this, or tell me an easier way to do this, that would be amazing.

Last seen on 00:07, 8. Apr 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So, I haven't tried this for…
Sun, 07/02/2023 - 01:40

So, I haven't tried this for as long as you, so this may not work. But here's my idea.

Make a procedure and set it as tick update for your phase 1 boss. Use an if statement and compare current entity health and max health/2.

If that is the case, summon the phase 2 entity at the x, y, and z position of the targ entity.

Then set the rotation of the nearest phase 2 entity to the yaw and pitch of the targ entity.

Finally, teleport the phase 1 entity to X, -70, Z and deal 100 OUT_OF_WORLD damage to it. This will instantly make it disappear in the same tick as everything else. It also doesn't create ghost entities, unlike the despawn block.