setHealth

Discussion in 'Bukkit Help' started by jeussa, Jul 17, 2013.

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

    jeussa

    hey there,

    just wondering why it shows this:
    p.setHealth(20);
    when using bukkit_1.5.2

    and this:
    p.setHealth(20);
    when using bukkit_1.6.2

    And also: how can I solve this?
     
  2. Offline

    martian3333

    jeussa
    Umm... where does it show this at? I'm not sure what the problem is there?
     
  3. Offline

    jeussa

    This is caused at all setHealth method in my plugin.

    Here's an example:

    Code:java
    1. @EventHandler
    2. public void onInteract(PlayerInteractEvent evt){
    3. Player p = evt.getPlayer();
    4. if(p.getItemInHand().getTypeId() == Material.POTION.getId(){
    5. if(evt.getAction() == Action.LEFT_CLICK_AIR ||evt.getAction() == Action.LEFT_CLICK_BLOCK){
    6. p.getWorld().playEffect(p.getLocation(), Effect.POTION_BREAK, 1);
    7. p.setHealth(20);
    8. }
    9. }
    10. }



    Error: 'The method setHealth(int) from the type Damageable is deprecated'

    This only occures whenvusing 1.6 and not when using 1.5
     
Thread Status:
Not open for further replies.

Share This Page