Hello there any way to get the player has killed other, ie to make a minigame two players and that when I ended can get the player that killed the other and place it in a variable.
PHP: public function onDeath(PlayerDeathEvent $event){ $player = $event->getPlayer(); $lastDamageCause = $player->getLastDamageCause(); if ($lastDamageCause instanceof EntityDamageByEntityEvent) { $killer = $lastDamageCause->getDamager(); if ($killer instanceof Player) { //Killer is a player, set wherever you need it! } }}