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

Invalid plugin manifest: Invalid Plugin commands, key must be the name of the command

Discussion in 'Plugin Help' started by tpguy825, May 12, 2022.

  1. tpguy825

    tpguy825 Spider

    Messages:
    11
    GitHub:
    tpguy825
    I'm having issues setting up commands in my plugin.yml file and I can't seem to find what I have done wrong

    Plugin.yml:
    Code:
    commands:
     startweb:
      description: Starts the web server
      usage: "/startweb"
      permission: "pmmpweb.command.startweb"
     stopweb:
      description: Stops the web server
      usage: "/stopweb"
      permission: "pmmpweb.command.stopweb"
    
    Screenshot:[​IMG]
     
  2. FresherGAMING

    FresherGAMING Spider Jockey

    Messages:
    42
    GitHub:
    FresherGAMING
    I think the error is not in the plugin.yml, but on how you register your command
     
  3. tpguy825

    tpguy825 Spider

    Messages:
    11
    GitHub:
    tpguy825
    In what way?

    Edit: here is main.php
    PHP:
    // this is based on pmmp/ExamplePlugin
    public function onCommand(CommandSender $senderCommand $commandstring $label, array $args) : bool{
            switch(
    $command->getName()){
                case 
    "startweb":
                    
    // other stuff
                    
    return true;
                case 
    "stopweb":
                    
    // other stuff
                    
    return true;
                default:
                    return 
    false;
            }
        }
     
    Last edited: May 13, 2022
  4. FresherGAMING

    FresherGAMING Spider Jockey

    Messages:
    42
    GitHub:
    FresherGAMING
    Sorry, I can't help, I don't see anything wrong
     
  5. GamingFR91

    GamingFR91 Spider Jockey

    Messages:
    29
    GitHub:
    kanekilechomeur
    You just did errors with the spaces on the configuration
    Code:
    commands:
      startweb:
        description: Starts the web server
        usage: "/startweb"
        permission: "pmmpweb.command.startweb"
      stopweb:
        description: Stops the web server
        usage: "/stopweb"
        permission: "pmmpweb.command.stopweb"
    
     
  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.