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

Best way to register commands

Discussion in 'Facepalm' started by NotRedd, Jun 12, 2017.

  1. NotRedd

    NotRedd Silverfish

    Messages:
    17
    What's the best way to register commands using Multiple PHP classes?
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    The same way it's done in PocketMine's source code
     
    Kenn Fatt likes this.
  3. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    All ways are good, and there are more ways than what've been mentioned on this forum. What is most convenient for you is the best for you. If it's just a small plugin with several commands, declaring the commands in plugin.yml and handling them in onCommand is enough. Putting them in separate classes does not give any performance gain. Unless you need to dynamically declare commands, the plugin.yml + onCommand way is the most pragmatic.
     
    jasonwynn10 and Jack Noordhuis like this.
  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.