public function onDeath(PlayerDeathEvent $e)
{
$p = $e->getPlayer();
if ($p instanceof Player) {
$cause = $p->getLastDamageCause();
if ($cause instanceof EntityDamageByEntityEvent) {
$light = new AddEntityPacket();
$light->type = 93;
$light->eid = Entity::$entityCount++;
$light->metadata = array();
$light->speedX = 0;
$light->speedY = 0;
$light->speedZ = 0;
$light->x = $p->x;
$light->y = $p->y;
$light->z = $p->z;
$p->dataPacket($light);
}
}
}