pocketmine\event\entity\EntityDeathEvent::getDrops PHP Method

getDrops() public method

public getDrops ( ) : Item[]
return pocketmine\item\Item[]
    public function getDrops()
    {
        return $this->drops;
    }

Usage Example

Example #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);
     }
 }
All Usage Examples Of pocketmine\event\entity\EntityDeathEvent::getDrops