Jump to content

[1.7.10][SOLVED]Player health?


BuddingDev

Recommended Posts

I plan to increase the player's health up, and up. (Of course, I will add some more code to limit that.)

And THEN after that player died and respawn, I want their health back to normal.

 

That is:

The player is alive, he has a max of 100 health

Unfortunately he is killed by a great mass of blowin creepers

Now, he respawns, he have 20 health, as much as the default.

 

How do I do that?

Link to comment
Share on other sites

OK, I got that. Problem is solved.

 

I heal and increase the total health of the player at an interval. (So, when he is healed, he gains some max health)

For example, he is healed 2 hearts and gained 2 hearts for max health.

Then, he dies, with his current health larger than normal. (Say, he dies with max health = 100)

Then, his health is back to normal (20).

 

I intercepted PlayerRespawnEvent, and have the health adjusted back to normal.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.