Solved My plugin wont work FIXED

Discussion in 'Plugin Development' started by vhbob, Apr 5, 2015.

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


    Last edited: Apr 6, 2015
  2. Offline


    Maybe use
    Syntax? :P
  3. Offline


    What do you mean syntax?
  4. Offline


    @vhbob He's telling you to put your code in [ code] [ /code] blocks.
  5. Offline


    Ive put my code in the code blocks
  6. Offline


    Do you have a plugin.yml?
  7. Offline


    You need a plugin.yml, your class to be implementing CommandExecutor and you also need to register the command both in the yml and plugin itself.
  8. Offline


    Like @Msrules123 said you need to create a plugin.yml in the project. Also why do you have the @Override tags in the onEnable() and onDisable() methods? They shouldn't be necessary. And finally, you don't want to have your onCommand boolean return false, that doesn't make sense.
  9. Offline


    • The onEnable and onDisable do not need @Override
    • Logger is already added to the plugin.
    • You have a two returns, one of which is not needed.
    • You return false.
    Now, that's not the reason your plugin isn't working, but it does tell me that you are new to Java and that you are probably using a Youtube Tutorial, which I highly suggest you not follow.

    It can be a buildpath problem or a Plugin.yml error.
  10. Offline


    Show us the plugin.yml
  11. Offline


    @Zombie_Striker @Booshayy, if you ever program professionally, refusing to use @Override will get you fired. Don't even try to write inheritance without it.
  12. Offline


    @Tecno_Wizard Yes, however they're not saying its not needed ever. They are say it is not needed in this situation and he doesn't even have any code in his onDisable why would he need an @Override?
  13. Offline


    It's good practice really. It helps with readability when other developers look at your code. Also, you tell the compiler that you are really going to override a method from a superclass. If you misspelt the method name that you are trying to override (annotated by @Override) your IDE will throw an error, and save you from hours and hours of frustration overnight finding out why your plugin doesn't work only to see you spelt it onEnabel(). (This happened to me more or less. Now I go ape with @Override)

    Now that's not going to happen here most of the time, but in the professional world of programming, that @Override is pretty important and useful.
  14. Offline


    Ironically, even though I agree with what you said and the fact that @Override is very imporant to use, it doesn't even compile...
  15. Offline


    @meguy26, no, it doesn't, but it will throw a compiler error if you make a mistake and save you a few hours of debugging.

    @vhbob, Back to the question at hand. Can you give us more information about what happens when you try to load your plugin? The code you have posted here is fine, so it looks like the problem lies in your plugin YAML file, or lack thereof.
Thread Status:
Not open for further replies.

Share This Page