Skip to content

EntityDamageByChildEntityEvent ​

class · pocketmine\event\entity\EntityDamageByChildEntityEvent · source

Extends EntityDamageByEntityEvent

Called when an entity takes damage from an entity sourced from another entity, for example being hit by a snowball thrown by a Player.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Entity $damager, \pocketmine\entity\Entity $childEntity, \pocketmine\entity\Entity $entity, int $cause, float $damage, array $modifiers = [])

getChild() ​

php
public function getChild() : ?\pocketmine\entity\Entity

Returns the entity which caused the damage, or null if the entity has been killed or closed.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.