This is the Problem: [14:16:43] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected ' ' (T_STRING), expecting '{'" (EXCEPTION) in "plugins/teleporter/src/fixed/Main" at line 16 And this is my Code: <?php namespace Server; use pocketmine\plugin\PluginBase; use pocketmine\event\Listener; use pocketmine\command\CommandSender; use pocketmine\command\Command; use pocketmine\Player; use pocketmine\plugin\Plugin; use jojoe77777\FormAPI\SimpleForm; class Main extends Listener{ public function openHelpUI(){ $form = new SimpleForm(function(Player $player, int $data = null) {}); $form->addbutton("§3Citybuild"); } } public function onCommand(CommandSender $sender, string $commandLabel, array $args) { switch ($args[0]) { case "tpuicity": $this->openHelpUI($sender, "Menu Opened"); } }
Your bracket's didn't match up, here I fixed it: PHP: <?phpnamespace Server;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\command\CommandSender;use pocketmine\command\Command;use pocketmine\Player;use pocketmine\plugin\Plugin;use jojoe77777\FormAPI\SimpleForm;class Main extends Listener { public function openHelpUI(){ $form = new SimpleForm(function(Player $player, int $data = null) {}); $form->addbutton("§3Citybuild"); } public function onCommand(CommandSender $sender, string $commandLabel, array $args) { switch ($args[0]) { case "tpuicity": $this->openHelpUI($sender, "Menu Opened"); } }} Please indent your code in the future and use an IDE to prevent errors like that