[20:35:09] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected '}', expecting ')'" (EXCE

Discussion in 'General discussion' started by AlmondSalmon754, Jun 11, 2021.

  1. AlmondSalmon754

    AlmondSalmon754 Spider

    Messages:
    7
    Hello there! I am working on a super lite lobby plugin. I am using EasyForms as the only dependency in my project:
    Here is my code:
    Code:
    use pocketmine\plugin\Plugin;
    use pocketmine\event\Listener;
    
    class Main extends PluginBase {
      public function onJoin(PlayerJoinEvent $event){
        $player = $event->getPlayer();
        $player->sendForm(new MenuForm("Select server", "Choose server", [new Button("Survival Games (#1)", new Image("[MEDIA=imgur]QZd5cvA[/MEDIA]"))], new Button("TnTRun (#1)", new Image("[MEDIA=imgur]MOWubbu[/MEDIA]"), new Button("SkyBlock (#1)", new Image("[MEDIA=imgur]GFljJhJ[/MEDIA]")), function(Player $player, Button $selected) : void{
           $player->sendMessage("You selected: " . $selected->getText());
           $player->sendMessage("Index of button: " . $selected->getValue());
      }
    )
    }
    
    Sorry if my code absolutely sucks, I am a beginner
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    703
    https://phpcodechecker.com/

    Break your code with line breaks so it's easier to read and actually understand where the syntax error is. I could do that for you, but it's wrong to do so.
     
    minijaham likes this.
  3. BestCodrEcer

    BestCodrEcer Spider

    Messages:
    11
    GitHub:
    bestcodrever
    Can you please send your full error
     
  4. Axon

    Axon Zombie

    Messages:
    266
    You don't need the full error to understand it, there is a syntax error which can be checked with the link Primus sent. :smile:
     
    Last edited: Jun 18, 2021
    Agent, Primus and minijaham like this.
  5. BestCodrEcer

    BestCodrEcer Spider

    Messages:
    11
    GitHub:
    bestcodrever
    Ok my bad :D
     
    Axon likes this.
  6. Axon

    Axon Zombie

    Messages:
    266
    It’s fine :cat:‍:eyeglasses:
     
    Last edited: Jun 20, 2021
    Agent likes this.
  7. minijaham

    minijaham Zombie Pigman

    Messages:
    737
    GitHub:
    minijaham
    People who didn’t get your extension be like:
     
    Agent, Axon and NTT like this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.