1.6.4to 1.7.9 Some problems with player Health

Discussion in 'Plugin Development' started by paxi, Jun 24, 2014.

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

    paxi

    Hello everybody,

    i have a problem with one of my plugins. The plugin was for 1.6.4 and now with 1.7.9 i have some questions:
    Can i use player.getHealthScale() for getting information how many half hearts a player has? So that when i get 22 back it means that the player has 11 hearts?
    Because when i use getHealth eclipse says its ambiguous....

    And which void can i use to get the number of the Lastdamage which the player gets? The old methode getLastDamage() does not exist...

    Thanks :)
     
  2. Offline

    Zupsub

    paxi likes this.
  3. Offline

    bdubz4552

    paxi This is odd, as I have used getHealth() in a plugin, and have seen getLastDamage() in the list of methods for entities. Zupsub is probably right, make sure you put Bukkit instead of CraftBukkit in your build path.
     
    paxi likes this.
  4. bdubz4552 Zupsub paxi
    In eclipse, go to "Order and Export" under Build Path and make sure Bukkit is loaded first.
     
    paxi likes this.
  5. Offline

    teej107

    or just cast the player as a Damageable.
     
  6. Offline

    TheHandfish

    GetHealth uses doubles now, so I believe, for example, a returned value of 3.5 would mean the player has 3 and 1/2 hearts.
     
  7. Offline

    ZodiacTheories

  8. TheHandfish ZodiacTheories The total health as a double(for Players) is 20. 1 = 1/2 a heart. Something is definitely wrong if you get 22 back, unless it's not a Player.
     
  9. Offline

    Konkz

    Seeing he was talking about #getHealthScale I can assume that he was messing around with how many hearts a player has.
     
  10. Offline

    TheHandfish


    Whoa, Twitter-style tagging. :eek:

    Forgive me if this is sort of off-topic, but how did Mojang changing health from int to doubles help?
     
Thread Status:
Not open for further replies.

Share This Page