targetItem->isNull(); } public function onPreExecute(Player $source) : bool{ $source->getServer()->getPluginManager()->callEvent($ev = new PlayerDropItemEvent($source, $this->targetItem)); if($ev->isCancelled()){ return false; } return true; } /** * Drops the target item in front of the player. * * @param Player $source * * @return bool */ public function execute(Player $source) : bool{ return $source->dropItem($this->targetItem); } public function onExecuteSuccess(Player $source) : void{ } public function onExecuteFail(Player $source) : void{ } }