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); } }
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); } }