Command shows usage?

Discussion in 'Plugin Development' started by JoelyBob, Apr 24, 2015.

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

    JoelyBob

    Hey,

    I am working on a plugin, and this plugin includes typing the command, and a message being sent to the command sender. I have created the plugin with no errors whatsoever, and no errors on run of the plugin. However, when I use the command, all it does is simply sends the text in the 'usage' part of the plugin.yml

    Here are my classes and plugin.yml, please help me!

    Main: http://pastebin.com/TqdxUwpH
    DollarHelp: http://pastebin.com/7W8E9vYd
    plugin.yml: http://pastebin.com/XsTymg0K
     
  2. Offline

    SuperOriginal

    Why do all your classes extend JavaPlugin..?
     
  3. Offline

    Konato_K

    @SuperOriginal I heard that if you have 5 or more classes extending JavaPlugin and use nuclear-magic-fusion technique over them you can get a SuperJavaPlugin class which is 10 times more powerful and can deal more damage than a normal JavaPlugin.

    Wait what?

    @JoelyBob you're returning false
     
    vhbob and mythbusterma like this.
  4. Offline

    SuperOriginal

    @Konato_K Well it turns out the OP only has 3 classes extending JavaPlugin, and without his SuperJavaPlugin bonus, the proper use of Bukkit documentation actually deals double damage, resulting in an instant victory.


    I win.
     
    mythbusterma and Konato_K like this.
  5. Offline

    Tamir

    @JoelyBob Just get rid of usage:
    It isn't necessary, and just annoying.
     
  6. Online

    timtower Administrator Administrator Moderator

    @Tamir That is an opinion, not a fact
     
  7. Offline

    Tamir

    @timtower
    True, but its still isn't necessary
     
  8. Offline

    vhbob

    @JoelyBob your spacing seems to be off...
     
  9. Online

    timtower Administrator Administrator Moderator

  10. Offline

    vhbob

    @timtower it seems his usage and description are 3 away from the command and the command is 2 away from the start
     
  11. Online

    timtower Administrator Administrator Moderator

    @vhbob 3 and 6 from line start. Not related to this issue though :p
     
  12. Offline

    vhbob

    @timtower ah ok my bad ;) i go it though its not usage: <command>, its usage: /shop or usage: /whatever @JoelyBob
     
  13. Offline

    JoelyBob

    I'll test it out now!
     
  14. Offline

    vhbob

    @JoelyBob alright! is should work if you do /help <Command>
     
  15. Offline

    JoelyBob

    Didn't seem to work. The /help <command> worked, but it came up with a blank usage and the command does nothing.
     
  16. Offline

    vhbob

    let me see your plugin.yml please @JoelyBob
     
  17. Offline

    JoelyBob

    Code:
    name: PvPBoxEcon
    main: me.biskitdev.pvpboxecon.PvPBoxEcon
    version: 1.0
    commands:
       m:
         description: Main Econ Command
         aliases: [e, m, money]
         usage: /m
    There :D
     
  18. Offline

    vhbob

    @JoelyBob your description, aliases, and usage need to be 3 spaces away from the M: atm there only 2 change ur plugin.yml to this:
    Code:
    name: PvPBoxEcon
    main: me.biskitdev.pvpboxecon.PvPBoxEcon
    version: 1.0
    commands:
       m:
          description: Main Econ Command
          aliases: [e, m, money]
          usage: /m
     
  19. Offline

    JoelyBob

    Now It says it's an unknown command?
     
  20. Offline

    MrHatz2

    i thought it was any mount of spaces as long its consistet
     
  21. Offline

    RuthlessRage

    @JoelyBob Pointless... something tells me in your command class you're returning false so put your normal usage back and in your command class return true. it will show the usage regardless if you have everything else set up right if you have it returning false so return it true for the oncommand boolean

    If i was you i'd make one main class that registers the command like so
    getCommand("Ragetag").setExecutor(new CmdClass(this));

    and a command class that has the command
     
    Last edited: Apr 25, 2015
  22. Offline

    Xerox262

    @JoelyBob This would be why it's saying usage:
    Code:
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
            return false;
    
        }
    
    That's in your main class, so any command you do that is in the plugin .yml is going to return false (meaning show usage) unless you remove that and setup an executor in your on enable
    Code:
    getCommand("m").setExecutor(new DollarHelp(this));
    also remove the "extends JavaPlugin implements Listener" from your command class

    Edit: I should proof read when I type
     
Thread Status:
Not open for further replies.

Share This Page