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