Solved Player's Health

Discussion in 'Plugin Development' started by bubblefat_, Jun 15, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    bubblefat_

    Whenever I use player.getHealthScale() it always says 20.0 no matter how much health. Anyone know why?
     
  2. Offline

    Xerox262

    getHealthScale will return the how many hearts that player can see on their screen. Which by default would be 20 half hearts. Try consuming an enchanted golden apple and see if this changes due to the extra hearts.
     
  3. Offline

    bubblefat_

    Solution

    Code:
            Damageable p = (Damageable) killer;
            double rounded = Math.round(p.getHealth() * 10) / 10;
     
  4. Offline

    justin_393

    Uh... If you want the health just do player#getHealth() why would you round and then multiply then divide?
     
Thread Status:
Not open for further replies.

Share This Page