1.8.8 Custom Health

Discussion in 'Spigot Plugin Development' started by i7i7u6u6, Jul 11, 2021.

Thread Status:
Not open for further replies.
  1. I was wondering how I would make a custom health system similar to hypixel skyblock and how to make weapons interact with the health system.
     
  2. How I would do it is store the max health and the actual health on a Map or HashMap (Basically make some sort of class that manages this). Then, to apply damage you could listen for the EntityDamageEvent, and substract the caused damage to the stored value on the HashMap (you will need to cancel this event).

    Finally, to make it more visual, you could get the health, divide it by 20, and display it on the player's health.

    If I helped you, I would appreciate if you could react this message.
     
    • Useful Useful x 2
  3. I would add a persistent data container for each player which could hold the health value.
     
Thread Status:
Not open for further replies.