Procedure help: Replacing one entity with another at certain HP

Started by Kyuumulo on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 years ago
Joined Jul 2023
Points:
203

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 0
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.

Active 3 months ago
Joined Nov 2022
Points:
423

User statistics:

  • Modifications: 2
  • Forum topics: 10
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 54
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.