Suggestion: Generate a config file so users could configure the number of diamonds giving the killer.
Okay i've made the plugin. Unfortunatly i havent been able to test it but theres no errors so thats a start. If you want anything else added to it please just ask. EDIT: Should be working now. Source code: https://github.com/TheDiamondYT1/PluginRequests/tree/master/DiamondsOnDeath Download: https://github.com/TheDiamondYT1/Pl...sOnDeath/DiamondsOnDeath_v1.0.0.phar?raw=true (When i get dl.thediamondyt.tk working again i will put the download link there)
Idek i havent done pocketmine in a while and dont have another client to test. EDIT: Hopefully fixed it now thanks to @corytortoise
@TheDiamondYT @SOFe PHP: public function onEntityDamage(EntityDamageEvent $event){ if($event->getEntity() instanceof pocketmine\Player && $entity->getHealth() - $event->getDamage() <= 0 && $event instanceof EntityDamageByEntityEvent){ $damager = $event->getDamager(); //Award $damager diamonds }}