hello, I was wondering if there is any type of event that causes the player to be thrown up when using an item?
Heres Some Code From One Of My Old Plugins It Leaps You In The Air When You Interact With A Feather PHP: <?phpnamespace Taco\TacoLeap;//use pocketmine\Player;use pocketmine\Server;use pocketmine\item\Item;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\event\player\PlayerInteractEvent;use pocketmine\utils\Config;//Sorry if im using a really old config method//Im new to pocketmine programming and i had no Internet//No help from forums, discord, or the pocketmine api in general//The config should work thoughclass Main extends PluginBase implements Listener { public $cd = []; public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); if (!file_exists($this->getDataFolder() . "config.yml")) { $config = new Config($this->getDataFolder() . "config.yml", Config::YAML,[ "cooldown" => 5, ]);//Tacos Epic Config Method }} public function onLeapPluginInteract(PlayerInteractEvent $event) { $player = $event->getPlayer(); $config = new Config($this->getDataFolder() . "config.yml", Config::YAML); if($event->getItem()->getID() === 288) { //Make Sure To Change To Feather if(!isset($this->cd[$player->getName()])) { $this->cd[$player->getName()] = time() + $config->get("cooldown"); $x = $player->getX(); $y = $player->getY(); $z = $player->getZ(); $lvl = $player->getLevel(); $dir = $player->getDirectionVector(); $drx = $dir->getX(); $drz = $dir->getZ(); $player->knockBack($player, 0.5, $drx, $drz, 0.1); //Change If Needed } else { if(time() < $this->cd[$player->getName()]) { $timeleft = $this->cd[$player->getName()] - time(); $player->sendMessage("§eCooldown:§a" . $timeleft . "§eSeconds"); } else { unset($this->cd[$player->getName()]); } } } } }//Cool This Took Forever Lmao, Ive Never Used Time Or Anything With CoolDowns In General thanx