40 $location = $player->getLocation();
42 $projectile = $this->createEntity(Location::fromObject($player->getEyePos(), $player->getWorld(), $location->yaw, $location->pitch), $player);
43 $projectile->setMotion($directionVector->multiply($this->getThrowForce()));
46 $projectileEv->call();
47 if($projectileEv->isCancelled()){
48 $projectile->flagForDespawn();
49 return ItemUseResult::FAIL;
52 $projectile->spawnToAll();
58 return ItemUseResult::SUCCESS;