Assuming $player is a Player object and $this is a PluginBase PHP: $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI");if($api === null || $api->isDisabled()){ return;}$form = $api->createSimpleForm(function (Player $player, array $data){ $result = $data[0]; if($result === null){ // Closed form without submitting return; } switch($result){ case 0: $player->sendMessage("Ok!"); return; case 1: $player->sendMessage("Why not?"); return; }});$form->setTitle("Example Form");$form->setContent("Would you like to X?");$form->addButton("Yes");$form->addButton("No");$form->sendToPlayer($player);