How do LivingEntities die?

Discussion in 'Plugin Development' started by gamerguy14, May 23, 2012.

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

    gamerguy14

    I have been trying to kill mobs through my plugin but I can't seem to get it right. I tried throwing the EntityDeathEvent which worked to trigger the event through plugins but didn't kill the mob. I tried playing the effect too but it just plays the effect and turns the mobs invisible. If I try to remove the mob, then it disappears even before the effect can finish playing through. I have tried different combinations but it didn't work. So my question is, how does bukkit do it or what is the best way to reproduce the death?
     
  2. Offline

    r0306

    gamerguy14
    Very...slowly. Jk. To answer your question, you would set their health to 0.
    Code:
    LivingEntity le = (LivingEntity) event.getEntity;
    le.setHealth(0);
     
  3. Offline

    gamerguy14

    Worked great thanks!
     
  4. Offline

    r0306

Thread Status:
Not open for further replies.

Share This Page