Ambiguous e.getHealth()

Discussion in 'Plugin Development' started by htmlman1, Aug 18, 2014.

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


    I'm pretty sure this is a pretty stupid question to ask.

    Now, I've used this function before with no problems so I'm very confused as to why I'm getting this error now.

    Basically this is my code:
    1. double health = e.getHealth();
    2. double maxhealth = e.getMaxHealth();

    I know there's a deprecated version of both of these that returns a int value but still...the functions should have different signatures.
  2. I haven't tested your code, but I guess the player health is not a double. Try changing your variables to ints.

    Post the stack trace in case of further problems :p
  3. Offline


    htmlman1 depend on Bukkit instead of CraftBukkit
    htmlman1 likes this.
  4. Offline


    Well, this code is for the LivingEntity class.
    Thanks. Can't believe it was something so simple :D
  5. fireblast709 Why you rob me of this moment? :p

    htmlman1 Official:

    Gater12, htmlman1 and mythbusterma like this.
  6. Offline


    AdamQpzm I think I've almost gotten through all the links...
    DinosParkour likes this.
  7. htmlman1 Heh. Next time, it'd be better to just search for it in the first place :p
Thread Status:
Not open for further replies.

Share This Page