getDrops() public method

public getDrops ( ) : Item[]
return pocketmine\item\Item[]
Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 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);
     }
 }