Call to a member function getDamager() on null" (EXCEPTION) in "/KillerTime.phar/src/VCraft/KT/Main" at line 22 PHP: $ca = $entity->getLastDamageCause(); $ks = $ca->getDamager(); if($ks instanceof Player){
Because $ca is null? Please provide your scope for the event. You may want to think about whether the entity really must have just been damaged. If he might not, check if $ca === null and do appropriate actions and stop code execution after handling this exceptional case.
Okay The full code is PHP: public function onPlayerDeath(EntityDeathEvent $event){ $entity = $event->getEntity(); $ca = $entity->getLastDamageCause(); $ks = $ca->getDamager(); if($ks instanceof Player){ $this->mcmmo->addskills($ks->getName(),1);