player.getMaxHealth() problem

Discussion in 'Plugin Development' started by sohardhun15, Jan 11, 2014.

Thread Status:
Not open for further replies.
  1. Pls fix this for me! (getHealth() is ambiguous for the type Player )
    1. private void addHeart(Player player) {
    2. double maxHealth = player.getMaxHealth();
    3. if (maxHealth < 30.0) {
    4. double newMaxHealth = maxHealth + 2.0;
    5. player.setMaxHealth(newMaxHealth);
    6. player.setHealth(player.getHealth() + 2.0);
    7. }
    8. }
  2. Offline


    Use Bukkit when working on your plugins, not CraftBukkit.
  3. I got more errors.
  4. Offline


    You get more errors when coding with Bukkit instead of CraftBukkit? Or the same error?
  5. Offline


    sohardhun15 The only reason you'd get more errors is if you're accessing NMS code. Have both dependencies, but set the Bukkit dependency to a higher priority.
  6. this is a sticky thread on this forum... (link)
    evilmidget38 likes this.
Thread Status:
Not open for further replies.

Share This Page