Command is not working for FormAPI? PHP: <?phpnamespace BlawoHD;use pocketmine\Server;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\utils\TextFormat;use pocketmine\Player;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\command\CommandExecutor;use pocketmine\command\ConsoleCommandSender;class Main extends PluginBase implements Listener { public function onEnable() { $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); if($api === null){ $this->getServer()->getPluginManager()->disablePlugin($this); } } public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args) : bool { if($cmd->getName() == "dsgvo"){ if($sender instanceof Player) { $api = $this->getServer()->getPluginManager()->getPlugin("FormAPI"); $form = $api->createModalForm(function (Player $sender, array $data){ $result = $data[0]; if($result === null){ return true; } switch($result){ } }); $form->setTitle("DSGVO"); $form->setContent("Bitte Akzeptiere die Datenschutzrichtlinie des Server!"); $form->setButton1(TextFormat::GREEN . "Akzeptieren"); $form->setButton2(TextFormat::DARK_RED . "Ablehnen"); $form->sendToPlayer($sender); } break; } return true; }}
it must be ? bool data PHP: $form = $api->createModalForm(function (Player $sender, ? bool $result= null){ if($result === null){ return true; } if($result) { } else { } }); Reffer to: https://github.com/BlockHorizons/FactionsPE/blob/reborn/src/factions/command/LeaveFaction.php#L53