public function kill() { if (!$this->isAlive()) { return; } parent::kill(); $this->server->getPluginManager()->callEvent($ev = new EntityDeathEvent($this, $this->getDrops())); foreach ($ev->getDrops() as $item) { $this->getLevel()->dropItem($this, $item); } if ($this->server->getProperty("experience.enable", true) and $this->server->getProperty("experience.mob-drop", true)) { $DropExp = $this->getExperience(); $vector = new Vector3(ceil($this->x), ceil($this->y), ceil($this->z)); $this->getLevel()->spawnExperienceOrb($vector, $DropExp); } }
/** * @param Player $entity * @param Item[] $drops * @param string|TextContainer $deathMessage */ public function __construct(Player $entity, array $drops, $deathMessage) { parent::__construct($entity, $drops); $this->deathMessage = $deathMessage; }