Healing to max health

Started by N00BTO0B89 on

Topic category: Help with modding (Java Edition)

Last seen on 01:47, 16. Apr 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Healing to max health

im having issues healing a boss ive created to full health when it spawns in, currently mcreator doesn't allow this boss to have the max amount of health that I wanted to so I had to find a work around for it I have it set so when the boss spawns in its max health gets set to 50000 but because of this it needs to heal to max health before being able to fight I currently haven't found a single way to heal it to max health either instantly or over a quick period of time

Last seen on 13:54, 28. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Not totally sure why it…
Sun, 04/07/2024 - 18:32

Not totally sure why it needs 50,000 health, but yes, I imagine that's outside the allowed bounds of the game. Normally, you would just set the entity's current health to it's max health, and it wouldn't be an issue. If this is causing problems, you could consider using absorbtion hearts... or just not giving the boss so much health? You can add built-in armor if you're worried about players defeating it to quickly. 50,000 is just really absurd. The warden is meant to be basically unkillable, and it only has, like, 500 hearts.

Last seen on 13:54, 28. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could also just make…
Sun, 04/07/2024 - 18:33

You could also just make your own health system. Make the entity invincible, but instead decrease some NBT tag or variable whenever it would normally take damage.

Last seen on 01:47, 16. Apr 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
so the big thing is that its…
Sun, 04/07/2024 - 18:45

so the big thing is that its meant to be used on a modded server and that there are tons of weapons in this server that could deal a very decent amount of damage. my main struggle isn't giving it the health its making it regen to max health almost how the wither is where when it spawns in it heals itself to max and then starts attacking.

Last seen on 13:54, 28. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, if you just want it to…
Mon, 04/08/2024 - 10:51

Oh, if you just want it to regen quickly, that's much easier. You could simply make a procedure that adds health, (by setting its current health to its current health plus a certain amount every tick), which would cause its health to increase at a constant rate. If you wanted to be a bit fancier, you could make it recover a percentage of its missing health each time the procedure runs. (You would instead make the amount added to its current health the result of multiplying the difference between max and current health by a given percent), which would cause it to heal proportionally faster the more hearts it's missing. 

Because the procedure will likely run every tick, if you want it to heal less than half a heart per 20th of a second, (the equivalent of recovering 10 hearts every second, which seems like a bit much), you could add an NBT tag to the entity that acts as a timer between heals; countdown the tag each tick, and when it reaches zero, reset the tag and heal the entity.

Last seen on 01:47, 16. Apr 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thank you so much ill give…
Wed, 04/10/2024 - 04:37

thank you so much ill give this a try