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

Plugin Not Loading

Discussion in 'Plugin Help' started by VpsOP, Oct 13, 2019.

  1. VpsOP

    VpsOP Creeper

    Messages:
    5
    Hi .I am very new to Making plugins. I am learning Making plugins. Console is showing error loading plugin.

    Code:
    [Server thread/ERROR]: Could not load '/storage/emulated/0/PocketMine-MP/plugins/MyPlugin' in folder '/storage/emulated/0/PocketMine-MP/plugins/': yaml_parse(): scanning error encountered during parsing: mapping values are not allowed in this context (line 7, column 9)
    This is My `plugin.yml` file

    Code:
    name:MyPlugin
    main:VpsOP\MainClass
    api:3.9.5
    version:1.01
    author:VpsOP
    
    commands:
     text:
     description:"Text Command"
    And this is MainClass.php pls guide me i am new.

    PHP:
    <?php
        
    namespace VpsOP;

    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\Player;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\Server;
    use 
    pocketmine\utils\TextFormat;

    class 
    MainClass extends PluginBase{
        
        public function 
    onLoad(){
            
    $this->getLogger()->info(TextFormat::WHITE "I've been loaded!");
        }
        
        public function 
    onEnable(){
            
    $this->getLogger()->info(TextFormat::DARK_GREEN "I've been enabled!");
        }
            
        public function 
    onCommand(CommandSender $player,Command $cmd,string $label,array $args) : bool{
        
            switch(
    $cmd->getName()){
            case 
    "text":
                 if(
    $player instanceof Player){
                    
    $player->sendMessage("Hey Buddy!")
               return 
    true;
               }   
            }
        
    }
     
  2. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Code:
    name: MyPlugin
    main: VpsOP\MainClass
    api: 3.9.5
    version: 1.01
    author: VpsOP
    
    commands:
      text:
        description:"Text Command"
     
    VpsOP and HimbeersaftLP like this.
  3. VpsOP

    VpsOP Creeper

    Messages:
    5
    Bro is there any error in MainClass.php?
    Pls
     
  4. Fadhel

    Fadhel Witch

    Messages:
    68
    GitHub:
    dimbis
    make sure that your plugins\YourPlugin\src\VpsOP\MainClass.php exists
     
  5. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    The error is in the plugin.yml, pretty much self-explained. You first have to fix that error and then you will be able to see if MainClass.php got any errors.
     
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    missing } at the end I think
     
  7. RoccoYT

    RoccoYT Spider

    Messages:
    14
    GitHub:
    RoccoTheDev
    Stellen Sie sicher, dass Sie den richtigen Ordner in der Folge haben
    Main: author \ pluginname \ Main
    Namespace: Autor \ pl Name

    Und unter anderem nutzten sie die api 3.9.4
     
  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.