I made my own plugin, with an error...

Discussion in 'Plugin Development' started by Minecrafter099, Dec 22, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Mrawesomecookie

    Minecrafter099
    On the pastebin you showed us you forgot to return true instead of return false at the end of your command. The return false should go outside of the if(label....) block of your code but not outside the public boolean onCommand()
     
  2. Offline

    Minecrafter099

    So to confirm, you're saying to do return true?
     
  3. Offline

    AoH_Ruthless

    Minecrafter099
    Your onCommand method needs to be edited.
    1. Why do you have an opening bracket at line 30? Remove that.
    2. It would be good practice to check if the sender's instance is a player before casting, otherwise you may receive internal errors, especially if you plan on uploading the plugin to devBukkit.
    3. Use cmd.getName(), because zp is the command name.
    4. return true if the command name is zp, otherwise return false.
    Because you are unsure:
    The command name (cmd.getName()), is the actual name of the command in your plugin.yml. Using the label will get all aliases, which in your case, are none. So use cmd.getName() in your case.
     
  4. Offline

    Minecrafter099

    What do you mean on everything? xD

    Also, it's saying now I need ANOTHER @Override statement?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  5. Offline

    Minecrafter099

Thread Status:
Not open for further replies.

Share This Page