Code: PHP: $api = $this->plugin->getServer()->getPluginManager()->getPlugin("FormAPI"); $form = $api->createSimpleForm(function (Player $player, $data){ $result = $data[0]; if($result === null){ } switch($result[0]){ case 1: $player->sendMessage("test"); break; } }); $form->setTitle("Test SOCKK"); $form->addButton("Butt", 1); $form->sendToPlayer($player);
PHP: function onCommand(CommandSender $sender, Command $cmd, string $label, array $args): bool { switch ($cmd->getName()) { case "buycraftui": if ($sender instanceof Player) { $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); if ($api === null || $api->isDisabled()) { } $form = $api->createSimpleForm( function (Player $sender, array $data) { $result = $data[0]; if ($result === null) { } switch ($result) { case 0: break; case 1: $this->cashForm($sender); break; } }); $form->setTitle(TextFormat::BOLD . "buycraft"); $form->setContent("Your cart: " . TextFormat::GOLD . $cart); $form->addButton(""); $form->addButton(TextFormat::BOLD . "cash' ); $form->sendToPlayer($sender); } else { $sender->sendMessage(TextFormat::RED . "Use this Command in-game."); return true; } break; } return true; } This is my code xd