I am working on a plugin that lets people fly but whenever they click enable, it doesn't work. Can someone tell me what I did wrong? PHP: public function mainFrom($player){ $plugin = $this->getServer()->getPluginManager(); $formapi = $plugin->getPlugin("FormAPI"); $form = $formapi->createSimpleForm(function (Player $event, array $args){ $result = $args[0]; $player = $event->getPlayer(); if($result === null){ } switch($result){ case 0: return; case 1: $sender->setFlying(true); return; case 2: $sender->setFlying(false); return; } }); $form->setTitle(TF::BOLD . TF::BLACK . "FlyUI Menu"); $form->setContent(TF::GRAY . "Enable/Disable Fly Mode!"); $form->addButton(TF::GREEN . "Enable"); $form->addButton(TF::RED . "Disable"); $form->addButton(TF::WHITE . "Cancel"); $form->sendToPlayer($player); } }
I was going to add something, like economy but I changed my mind. And I changed it to case 0 and 1 and it still does not work.