MCreator-Examples / Feedback

The Feedback Repository is a place where the community can suggest ideas for future videos. In some cases, I will pick things from this repository if I feel motivated or have an idea of how to add them.
https://github.com/MCreator-Examples
6 stars 0 forks source link

Custom Health Stat #21

Open ImDaMilan opened 3 years ago

ImDaMilan commented 3 years ago

DESCRIPTION (Required)

  1. I think it would be awesome to know how players can create custom stats, in this case, health! I'm working on a mod that has custom stats like strenght, damage, etc. that make a calculation on how much custom damage it would deal, but I don't know a way do make custom health, similar to the one on Hypixel Skyblock.
  2. I want to see how to make a custom health stat, that players can have and increase, but that also mobs will have, for example, a player would start out with 100 health, and an enderman will have, for example, 150 health, zombie will have 50 health, and so on, and weapons would deal damage based on that health, not the normal one. For example, a diamond sword, without any enchants or anything, would deal 25 health, and with enchants, for example (i know, i've said FOR EXAMPLE so many times), 70 health.

LIST OF KEY FEATURES (Required)

  • [1] How to make a custom health stat
  • [2] How to make players and mobs use that health stat
  • [3] How to make weapons deal damage that would decrease the custom health

I guess that this is insanely hard, but I would be so grateful if you find and show us a way to do this. Thank you for what you do!

A picture of what I would like to make:

northwesttreesgaming commented 3 years ago

Thanks for your request and using the tracker :D May requests don't get posted here so I don't really see them to often.

This would be possible for sure. I think the best way would be using Player Pesistent Global variables to store the players health stats. Then all you need to do is use a global procedure for when entity is attacked, then cancel the event if the entity is a player. Then run a script to deal custom damage to the variable. The only other thing needed to be done is a player tick update to test if the health variable is 0 and if true, then deal like 1/2 heart to the player for every second, this would give them some time to try to get their health stat up before they die. Also testing if they have >0 health could increase the health 1/2 a heart every second to slowly heal the player over time.

This is a really easy request for me to do so I should be able to fast track this request shortly.