I wanted to get damager who push/hit a player into void... But, problem is how can I achieve that? PHP: $p->getLastDamageCause()->getDamager; I think this will only work for when player hit player If im using this code and player drop into void, I think it will just return "void" as damager, is it? How can I get the damager who push/hit that player to void? It will be good if Pocketmine implant API like this: getLastHit()
Yep Save the player name when EntityDamageByEntityEvent is fired, and create a function to call out that name when PlayerDeathEvent But, I have no idea on how to send the message "You smashed $player to void" to that damager.. zzz
PHP: $name = "whatever that is:P";$player = null;if($player = $this->getServer()->getPlayer($name)){ // Player online$player->sendMessage();} // Player offline
You could save the last Entity colliding with the player i guess. I am sure there was an entity collide with entity event
I would love to help you with the message. I only need the function that is called on EntityDamageEvent
He did it that way. And still, you don't get the person pushing the other xD you can't even push players
There is a complete implementation here. This is, though, for falling, not void, but eventually that points to the same principle. https://github.com/LegionPE/LegionP...src/legionpe/theta/classic/ClassicSession.php (yes, I know that the code is slightly ugly with a line with 18 tabs. Blame @Lambo