EntityDamageByEntityEvent test killed

Discussion in 'Plugin Development' started by thechrisanator, May 1, 2017.

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

    thechrisanator

    How would I check if the mob a player hits is killed with this event? isDead() doesnt seem to work.

    Also, can I put a EntityDeathEvent inside an EntityDamageByEntityEvent?
     
  2. Offline

    yPedx

    @thechrisanator
    PHP:
    Entity mob event.getEntity();
    if(
    mob.isDead){
    //Do something
    }
    ?
     
  3. Offline

    thechrisanator

    no, because .isDead() checks before the player does the damage to the entity
    I need it after, to see if the hit kills the mobs

    And in this event, you can't get the mob's health
     
  4. Offline

    Irantwomiles

    check their health?
     
  5. Offline

    mine2012craft

    I haven't tested it, but use the EntityDeathEvent. Check if the entity killed is your selected entity (ex. Check for Mobtype, Name, UUID, etc) and if it is, trigger your desired code.
     
Thread Status:
Not open for further replies.

Share This Page