What event should I use? Here is the code: PHP: use pocketmine\event\player\PlayerDeathEvent;//my code//kitspublic function onPlayerDeath(PlayerDeathEvent $event){ if(isset($this->sessions[$event->getEntity()->getName()])){ unset($this->sessions[$event->getEntity()->getName()]); } } I can not solve this problem by killing the whale-start is not possible to receive and dying whale start again turns. Sorry, my bad English.
Why? How do you know that he didn't intend to use names as keys? And it should be $event->getEntity(). Don't reply unless you are sure it is correct. And how come someone liked that post?