ofc i used this (but i saved to cfg) in my mobwars plugin (i used this to get top 3 players top zombiekillers in the end of every games)
wait i'll test the code rn but i used entity zombie in Jason10w... in his EntityX plugin. (in instanceof Zombie)
didn’t test just saw this forum but this is how I would do it PHP: private $kills = [];public function onDeath(EntityDeathEvent $event): void{$entity = $event->getEntity(); //gets the entity that’s died$last = $entity->getLastDamageCause(); //cause of deathif($entity instanceof Zombie && $last instanceof EntityDamageByEntityEvent){ //checks if entity is zombie and if it’s attacked by entity$damager = $last->getDamager(); //whoever attacked the entity if($damager instanceof Player){ //if that damager is player$value = 1; //default valueif(isset($this->kills[$damager->getName()])){ //checks if player name is set in kills array$value += $this->kills[$damager->getName()]; //adds the value from kills array to $value}if($value >= 10){ //checks if value is higher or equal to 10unset($this->kills[$damager->getName()]); //removes player from kills array$damager->sendMessage("You killed 10 zombies"); //send messagereturn; }$this->kills[$damager->getName()] = $value; //add the $value to array}}}