PHP: <?phpnamespace Aenteritas;use pocketmine\Server;use pocketmine\Player;use pocketmine\event\Listener;use pocketmine\plugin\PluginBase;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\utils\Config;use pocketmine\event\player\PlayerExhaustEvent;use pocketmine\event\player\PlayerChatEvent;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\event\Cancellable;class Main extends PluginBase implements Listener { public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->getLogger()->info("aktiviert!"); } public function onJoin(PlayerJoinEvent $event){ $player = $event->getPlayer(); $event->setJoinMessage(null); $this->openMyForm($player); } public function openMyForm($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("§7[§eLord§bTown§7] §4Wir können dich nicht teleportieren, da der Server §7(§eCityBuild§7) §4offline ist! (Error-38273)"); break; case 1: $player->sendMessage("§7[§eLord§bTown§7] §4Wir können dich nicht teleportieren, da der Server §7(§bTNTRun§7) §4 offline ist! (Error-38279)"); break; } }); $form->setTitle("§l§eNavigator"); $form->setContent("Willkommen auf §eLord§bTown§r! Bitte wähle nun aus, was Du Spielen willst!"); $form->addButton("§eCityBuild §7[§2ONLINE§7]"); $form->addButton("§bTNTRun §7[§4OFFLINE§7]"); $form->sendToPlayer($player); return $form; } }?> When i join the server, nothing happens (no UI is showing and no output in console). What is wrong? I also have FormAPI installed.
What output should you have in the console? One thing I noticed is PHP: $form = $api->createSimpleForm(function (Player $player, int $data = null){ only has a single closing ), with 2 opening (, which should throw a syntax error.