Catch player before death

Discussion in 'Archived: Plugin Requests' started by Techtony96, Mar 22, 2013.

  1. Offline


    First off, this is NOT a plugin, but a code snippit, that i need. Sorry if this is in the wrong thread, I couldn't find where else to put it.

    I need to teleport a player when he would die, but if they are in the respawn screen, they are technically not in the world, and an NPE is returned. So, I need to check when a player is damaged and see if they would die from that strike. If they would, heal them, and then teleport them to where ever. I can do the teleporting and healing, I just can't figure out how to check if a player is about to die.

  2. Offline



    Check the damage
    Check the hp remaining

    Btw this thread should go under plugin development.
  3. Offline


    OK, i wasnt sure if it should go there since i was asking for stuff. I got it working!

    I didn't know there was a .getDamage()

Share This Page