Moreover, `"player.interact"` is only triggered when a player hits an entity. No one ever told you that the attacked is a player. (for example, it can be a falling sand or primed tnt attacked)

You can use `$entity->class===ENTITY_PLAYER` to check it as of Alpha_1.3.12 (the constants have been changed to class constants in the Alpha_1.14 rewrite. No idea why @shoghicp did that to make some plugins not working.)

You can use `"entity.health.change"` instead. The data are 
```php
$data=array("eid"=>$entity->eid, "entity"=>$entity, "cause"=>$cause);
if(is_string($cause))
    console($entity->player->username." is attacked because of ".$cause);
else{
    $killer=$this->api->player->getByEID($data["cause"]);
    if(!($killer instanceof Player))
        console($killer->username." attacked ".$data["entity"]->player->username);
}
```