i need help identifying what the sytnax error is. Error: syntax error, unexpected 'switch' (T_SWITCH) File: plugins/diamondarmor (5).phar/src/gear/main Line: 38 Type: ParseError THIS CRASH WAS CAUSED BY A PLUGIN Code: [29] $player = $event->getPlayer(); [30] $name = $player->getName(); [31] $inv = $player->getInventory(); [32] [33] $this->getServer()->broadcastMessage("Welcome $name to 4KT!"); [34] } [35] [36] public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args): bool{ [37] $player = $sender [38] switch ($cmd->getName()) { [39] case "gear": [40] if($player->hasPermission("gear.cmd")) { [41] if(!$sender instanceof Player){ [42] $sender->sendMessage("This Command is for Players ONLY!"); [43] { else } [44] $sender->getInventory()->addItem(Item::get(310,1,1)); [45] $sender->getInventory()->addItem(Item::get(311,2,1)); [46] $sender->getInventory()->addItem(Item::get(312,3,1)); [47] $sender->getInventory()->addItem(Item::get(313,4,1)); [48] $sender->sendMessage("You are geared up to fuck yo bitch!");
You forgot to close using semicolon before the switch-statement at line 37 PHP: public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args): bool{$player = $sender; // here you forgot to put semicolonswitch ($cmd->getName()) {