Help with the new health system

Discussion in 'Plugin Development' started by Jbitters3, Jul 21, 2013.

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

    Jbitters3

    As you know the new health system is in place. I read what EvilSeph said and could not understand it. Here is some example code I have.
    Code:
    if(player.getHealth() <= event.getDamage()){
                event.setCancelled(true);
                player.setHealth(player.getMaxHealth());
                player.setFoodLevel(20);
                player.setFireTicks(0);
                PlayerInventory inv = player.getInventory();
                Location l = player.getLocation();
    
    Could you show me the way on how to use it?
     
  2. Offline

    etaxi341

    Jbitters3 Change
    Code:java
    1. player.setHealth(player.getMaxHealth());

    into
    Code:java
    1. player.setHealth(Double.valueOf(player.getMaxHealth()));
     
  3. Offline

    Jbitters3

    etaxi341 I am still getting an error
     
  4. Offline

    microgeek

    And the error is? You're not doing much good saying "There's an error", unless you tell us what the error is. Simply reading the error messages will help you solve the issue.
     
  5. Offline

    Jbitters3

    microgeek The method getMaxHealth() is ambiguous for the type Player
     
  6. Offline

    microgeek

    foodyling likes this.
  7. Offline

    Jbitters3

    microgeek I know they changed to doubles, I listen to the guy who commented before and I still need to know how to correct it.
     
  8. Offline

    microgeek

    foodyling likes this.
  9. Offline

    Jbitters3

    microgeek How am I referencing it wrong? I have coded in awhile and now I am updating my plugins. That section of that post literally does not help at all.
     
  10. Offline

    microgeek

    foodyling likes this.
  11. Offline

    chasechocolate

    Jbitters3 put bukkit.jar (and if you are using CraftBukkit.jar, that too, although it is unnecessary) in your build path.
     
  12. Offline

    Jbitters3

Thread Status:
Not open for further replies.

Share This Page