Hi! Is it possible to change the button if player is op? PHP: public function openBattleForm($player){ $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); $form = $api->createSimpleForm(function (Player $player, int $data = null) { $result = $data; if ($result === null) { return true; } switch ($result) { case 0; $player->sendMessage(" "); break; case 1; $player->sendMessage(" "); break; } }); $form->setTitle("Test "); $form->setContent("Test"); if($player->isOp()){ //$player is here unknown of course(This is my problem) $form->addButton("You are op! "); }else{ $form->addButton("You are not op! "); } $form->addButton(" "); $form->sendToPlayer($player); return $form; Is this even allowed in the API?
Why are you even trying to do that? Why don’t you just send a different form and have a check if the player is op beforehand???????????????????(x20) And yes. Your method should work as well,
This is just an example. My originally purpose is way more laborius bc i have many Buttons etc. You have an idea where i could get the $player variable?