Solved Error when i type a custom command

Discussion in 'Plugin Help' started by Kayllon, Jan 13, 2021 at 6:52 AM.

  1. Kayllon

    Kayllon Spider

    Messages:
    8
    How i can solve this error ?
    I will put my main.php
    im brazillian, so i making my plugin in portuguese
    Screenshot_20210113-033251.png Screenshot_20210113-033930.png
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    509
    This one is easy, every variable should be defined somewhere. Can you find where $cmd is?

    Rename $cmd to $command, because that is what you get in the method parameters!
     
  3. Kayllon

    Kayllon Spider

    Messages:
    8
    Hm ok i will try
     
  4. J1don2x

    J1don2x Creeper

    Messages:
    1
    The problem is just, you defined Command as $command in the function parameters and you switched $cmd which is a undefined variable! To fix it, you'll have to switch $command->getName() instead.
     
  5. Primus

    Primus Zombie Pigman

    Messages:
    509
    Anyone else want to paraphrase it?
     

Share This Page

  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.