Command repeats itself.

Discussion in 'Plugin Development' started by Revival3, Mar 25, 2017.

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

    Revival3

    Hi, so I am making my first plugin, and I'm fairly new to all this stuff. So I got all the plugin up and running. But when I type my command it just repeats itself in chat.

    Hello.java class:
    http://pastebin.com/PyiN4857

    Plugin.yml file:
    http://pastebin.com/ywpuP7AJ



    I don't know what to do...
     
    Last edited: Mar 25, 2017
  2. Offline

    jobisingh

    Can you repost your plugin.yml, it says it was removed, also instead of using pastebin use the code option when replying or creating a thread
     
  3. Offline

    Revival3

    fixed

    @jobisingh

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Mar 25, 2017
  4. Online

    timtower Administrator Administrator Moderator

    Moved to plugin development
    @Revival3 It returns the usage when the onCommand returns false.
    Are the conditions in that if statement met?
     
  5. Offline

    Ragnarok_

    Remove the getLogger for onEnable(), Bukkit does this for you and it's not needed.

    Secondly, remove onDisable(), you're not using it so there's no reason to have it in the first place.

    Thirdly, why is @Override over on you're onEnable and onDisable()? Shouldn't it be over you're onCommand? If I'm not mistaken I don't recall the onEnable and onDisable needing a @Override. It's meant to override a parent method.

    Also, If you're question was resolved, please goto TopPage > Thread Tools > Edit Title > Solved
     
  6. Offline

    Drkmaster83

    The @Override annotation is used to make sure you don't mistype a parent method - the program will error out at compile-time if you're overriding a non-parent method . It is meant to override a parent method, and onEnable() and onDisable() are both parent methods in JavaPlugin. onCommand is, as well. So, if you wanted to, you can do them on all three.

    @Revival3 Yeah. as timtower said, it'll display the usage to the player if you return false; inside the onCommand. If you don't want it to do that, return true; instead.
     
Thread Status:
Not open for further replies.

Share This Page