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

Solved I can't find a way to attach my main file to my plugin.

Discussion in 'Development' started by GreenDude2009, Jun 21, 2022.

  1. GreenDude2009

    GreenDude2009 Creeper

    Messages:
    2
    Can someone help find a way to attach my main file to my plugin? I am new to this and I couldn't find any other posts on here with the same issue. Untitled3.png
    Edit: I forgot to attach the code in Main.php so here you go:
    PHP:
    <?php

    namespace TestPlugin;
    use 
    pocketmine\plugin\PluginBase;

    class 
    MainClass extends PluginBase {
        public function 
    onLoad() : void{
            
    $this->getLogger()->info("Plugin Loading");
        }
    }
     
    Last edited: Jun 21, 2022
  2. GreenDude2009

    GreenDude2009 Creeper

    Messages:
    2
    I found out why, I had included src\ in plugin.yml, and I had to change Main.php to TestPlugin.php.
     
  3. TacoError

    TacoError Spider

    Messages:
    7
    GitHub:
    TacoError
    Also, you don't have to include the exact api in your plugin.yml, 4.0.0 will work fine unless your using one that depends exactly on that version of pocketmine. Just so that you don't have to keep updating plugins that really don't need to be updated.
     
  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.