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

Server crashes when plugin loads apparently due to a command

Discussion in 'Facepalm' started by Indexfire, Sep 11, 2017.

  1. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    The server crashes every time it loads the plugin it says that the onCommand method must match onCommand in CommandExecutor my code is
    PHP:
    public function onCommand(CommandSender $senderCommand $cmdstring $label, array $args){

         
    //Etc

    }
    i dont see how it dosent match am i doing something wrong with plugin.yml or whatever?
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Declare return type bool.
     
  3. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    Theres such a thing in PHP now? Ah well, thanks :)
     
  4. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    PHP:
    public function onCommand(CommandSender $senderCommand $cmdstring $label, array $args): bool{
    // etc
    return true// change this to whatever , it doesn't have to be (true)!
    }
     
  5. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    Its already solved, but thanks anyway! :)
     
  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.