1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Plugin unexpected "}"

Discussion in 'Plugin Help' started by GeistFan, Apr 30, 2021.

  1. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    Hi. When the server loads my plugin it shows this error message:
    [11:39:44] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected '}'" (EXCEPTION) in "plugins/JoinLeave-1.1.2/src/JoinLeave/Main" at line 24
    [11:39:44] [Server thread/CRITICAL]: #0 pmsrc/vendor/pocketmine/classloader/src/BaseClassLoader(124): BaseClassLoader->loadClass(string[14] JoinLeave\Main)
    [11:39:44] [Server thread/CRITICAL]: #1 (): BaseClassLoader->{closure}(string[14] JoinLeave\Main)
    [11:39:44] [Server thread/CRITICAL]: #2 (): spl_autoload_call(string[14] JoinLeave\Main)
    [11:39:44] [Server thread/CRITICAL]: #3 pmsrc/src/pocketmine/plugin/PluginManager(167): class_exists(string[14] JoinLeave\Main, boolean 1)
    [11:39:44] [Server thread/CRITICAL]: #4 pmsrc/src/pocketmine/plugin/PluginManager(346): pocketmine\plugin\PluginManager->loadPlugin(string[81] C:\Users\arese\Desktop\Andere Ordner\MineWars Test Server\plugins\JoinLeave-1.1., array[1])
    [11:39:44] [Server thread/CRITICAL]: #5 plugins/PocketMine-DevTools.phar/src/DevTools/DevTools(49): pocketmine\plugin\PluginManager->loadPlugins(string[66] C:\Users\arese\Desktop\Andere Ordner\MineWars Test Server\plugins\, array[1])
    [11:39:44] [Server thread/CRITICAL]: #6 pmsrc/src/pocketmine/plugin/PluginBase(116): DevTools\DevTools->onEnable()
    [11:39:44] [Server thread/CRITICAL]: #7 pmsrc/src/pocketmine/plugin/PluginManager(552): pocketmine\plugin\PluginBase->setEnabled(boolean 1)
    [11:39:44] [Server thread/CRITICAL]: #8 pmsrc/src/pocketmine/Server(1785): pocketmine\plugin\PluginManager->enablePlugin(object DevTools\DevTools)
    [11:39:44] [Server thread/CRITICAL]: #9 pmsrc/src/pocketmine/Server(1771): pocketmine\Server->enablePlugin(object DevTools\DevTools)
    [11:39:44] [Server thread/CRITICAL]: #10 pmsrc/src/pocketmine/Server(1530): pocketmine\Server->enablePlugins(integer 0)
    [11:39:44] [Server thread/CRITICAL]: #11 pmsrc/src/pocketmine/PocketMine(291): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[58] C:\Users\arese\Desktop\Andere Ordner\MineWars Test Server\, string[66] C:\Users\arese\Desktop\Andere Ordner\MineWars Test Server\plugins\)
    [11:39:44] [Server thread/CRITICAL]: #12 pmsrc/src/pocketmine/PocketMine(321): pocketmine\server()
    [11:39:44] [Server thread/CRITICAL]: #13 pmsrc(11): require(string[113] phar://C:/Users/arese/Desktop/Andere Ordner/MineWars Test Server/PocketMine-MP.p)
    can you help me there?
    -GeistFan
     
  2. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
  3. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    You probably forgot to put a semicolone
     
  4. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    Where?
     
  5. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    Oh I found the error!
     
  6. Blip

    Blip Spider

    Messages:
    6
    GitHub:
    lanternserver
    Hey.. what was the error? I've been struggling with creating a plugin and my error message is pretty similar to yours, so maybe I did the same thing wrong ¯\_(ツ)_/¯
     
  7. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Syntax error. Aka learn php
     
    Agent likes this.
  8. Blip

    Blip Spider

    Messages:
    6
    GitHub:
    lanternserver
    I'm learning to code plugins to learn how to code php everyone's a beginner at some point. Also ig it's not cos I fixed all the syntax errors ):
     
  9. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Well, in order to flawlessly code plugins, you will first need to learn PHP, as it is written in php.
    But My thoughts on "beginners" in "coding" is a bit different than yours. If you're willing to learn coding, the first thing you would learn is the general structure which includes syntaxes! In my opinion, these are very simple to learn, so I don't think any beginners would even ask what went wrong with their syntax...
    Plus, the console literally tells you where it went wrong so it's not even hard to fix the error compared to some other languages!

    Perhaps try google before asking? I'm pretty sure there are many sources you can use!
     
    Agent likes this.
  10. Blip

    Blip Spider

    Messages:
    6
    GitHub:
    lanternserver
    I know, it's pretty bad, but I'm really not very experienced at all so I don't understand the error messages. I really have tried everything: I've googled it, used a php code checker, spent hours of just trial and error, and even now it says there aren't any syntax errors it still displays a message in the console.
     
  11. Blip

    Blip Spider

    Messages:
    6
    GitHub:
    lanternserver
    [11:54:34] [Server thread/CRITICAL]: #3 pmsrc/src/pocketmine/plugin/PluginManager(238): FolderPluginLoader\FolderPluginLoader->getPluginDescription(string[30] /opt/service/plugins/lanternMC)
    [11:54:34] [Server thread/CRITICAL]: #5 pmsrc/src/pocketmine/plugin/PluginBase(116): DevTools\DevTools->onEnable()
    [11:54:34] [Server thread/CRITICAL]: #4 plugins/PocketMine-DevTools.phar/src/DevTools/DevTools(69): pocketmine\plugin\PluginManager->loadPlugins(string[21] /opt/service/plugins/, array[1])
    [11:54:34] [Server thread/CRITICAL]: #6 pmsrc/src/pocketmine/plugin/PluginManager(552): pocketmine\plugin\PluginBase->setEnabled(boolean 1)
    [11:54:34] [Server thread/CRITICAL]: #7 pmsrc/src/pocketmine/Server(1785): pocketmine\plugin\PluginManager->enablePlugin(object DevTools\DevTools)
    [11:54:34] [Server thread/CRITICAL]: #8 pmsrc/src/pocketmine/Server(1771): pocketmine\Server->enablePlugin(object DevTools\DevTools)
    [11:54:34] [Server thread/CRITICAL]: #10 pmsrc/src/pocketmine/PocketMine(291): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[13] /opt/service/, string[21] /opt/service/plugins/)
    [11:54:34] [Server thread/CRITICAL]: #9 pmsrc/src/pocketmine/Server(1530): pocketmine\Server->enablePlugins(integer 0)
    [11:54:34] [Server thread/CRITICAL]: #12 pmsrc(11): require(string[68] phar:///opt/service/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
    [11:54:34] [Server thread/CRITICAL]: #11 pmsrc/src/pocketmine/PocketMine(321): pocketmine\server()
     
  12. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    This is the backtrace. Send me the error please!
     
    Agent likes this.
  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.