Solved How do i use getHealth() to specify if someone has a certain amount of health?

Discussion in 'Plugin Development' started by MCnumi, Aug 21, 2015.

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

    MCnumi

    Hi there,
    I am new to bukkit as I just started a week ago.
    I am wondering how I can ask how much health someone has with
    getHealth().

    Like, how can I check when the player hit half a heart using getHealth?
    thanks.
     
  2. Offline

    crolemol

    a half heart = 1 health
     
  3. Offline

    SkyleTyler1337

    Code:
    if(p.getHealth() == 1){
    }
     
  4. Offline

    MCnumi

    wow! thanks guys! never thought I would get responses so fast!

    Please lock.
    EDIT by Timtower: we don't lock when something is solved.
     
  5. Offline

    SkyleTyler1337

    @MCnumi put the status to solved
     
Thread Status:
Not open for further replies.

Share This Page