Getting Player Health

Discussion in 'Plugin Development' started by terturl890, Sep 26, 2013.

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

    terturl890

    I guess I still dont get it. I looked at the stickies in plugin Development but I cant seem to get a players (or mobs) health without it saying "Ambiguous for the type Player" in eclipse. Can anyone help?

    my code is

    if(p.getHealth() > 1.0D) {
    setMana(getMana() - manaDeductionDeath());
    p.setLocation(spawn);
    p.setLevel(levelBeforDeath());
    p.setHealth(p.getMaxHealth() - HealthPlusOne());
    }
     
  2. I don't know why, but if you attach CraftBukkit jar file to the library path, it does that. You should always use Bukkit jar file unless you're using NMS code or directly accessing net.minecraft.server package which is not recommended.

    The other solution is to suppress the warnings using:
    Code:
    @SuppressWarnings("ambiguous")
    I'm not sure what goes in the quotation marks but it should be "ambiguous".
     
Thread Status:
Not open for further replies.

Share This Page