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

Weird Main class not found

Discussion in 'Plugin Help' started by BlueWhaleYT, Jul 9, 2020.

  1. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    42
    GitHub:
    bluewhaleyt
    Hey there, something I wanna ask here and it makes me confused for several days.
    I made a really simple plugin that's just for enabling the plugin.

    My Main.php file path:
    /Test/src/Test/Main.php

    My plugin.yml file path:
    /Test/plugin.yml

    Here's the code.
    PHP:
    <?php

    namespace Test;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\Server;
    use 
    pocketmine\Player;

    use 
    pocketmine\event\Listener;

    class 
    Main extends PluginBase implements Listener{
     
      public function 
    onEnable(){
        
    $this->getServer()->getPluginManager()->registerEvents($this$this);
      }
     
    }
    Code:
    ---
    name: Test
    author: BlueWhaleYT
    main: Test\Main
    api: 3.14.0
    version: 1.0.0
    ...
    it shows me Main class not found of this plugin. However, I try to put this plugin into Pocketmine-MP application then it works and run nicely. Once I put it into the Pterodactyl - a platform thats for hosting a game server, such as Minecraft Pocketmine is the among one. It shows me error even there's no such errors that regarding Main class couldnt find.

    I am really really confused for this and I have no idea to solve. I therefore find helps here, so as to know the truth.

    Thanks guys.
     

    Attached Files:

    • Test.zip
      File size:
      874 bytes
      Views:
      4
  2. MinekCz

    MinekCz Spider Jockey

    Messages:
    29
    Hi, your problem is that in plugin.yml it is written main (lowercase) and the file is named Main (uppercase)
     
  3. MinekCz

    MinekCz Spider Jockey

    Messages:
    29
    For some reason you had it written correctly on this page, but there was an error in the file you sent
     
  4. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    42
    GitHub:
    bluewhaleyt
    I changed it to Main no any change.
     
  5. MinekCz

    MinekCz Spider Jockey

    Messages:
    29
    For me, the plugin on the server works perfectly.



    Here is the phar I used and photo

    By the way Povolení means enable
     

    Attached Files:

  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.