Solved Error with plugin

Discussion in 'Spigot Help' started by DanTheDeveloper, Jun 7, 2018.

  1. I'm pretty new to coding in Java using the Bukkit Api, and have recently made a new plugin. The plugin works perfectly and it's main intention is to help moderate chat (ant spam, mutechat, clearchat, etc.) It worked fine on my test servers, but when I put it into my actual server, it didn't work, I restarted multiple times, and I couldn't locate a startup error, but here's an error when I try to plugman reload it:

  2. Strahan


    Well, I'm not really sure what you expect us to tell you when you do not post the code of the plugin.
  3. It's not the code, the code works perfectly fine, it works fine on test servers, just not my server
  4. Try removing all plugins from it then installing your plugin and see if it works.
  5. Post the line 84 of
  6. what do you mean?
  7. I plugman disabled every plugin except BoostChat, and it still doesn't work
  8. In the code's file the line 84 is causing the problem. So lets allow us to see that line at least.
    • Like Like x 1
  9. Yeah. Post your class please so we can see what's causing the error.
  10. Plugman is a plugin that reloads / disables / enables plugin in game. I /plugman reloaded the plugin to find an error, if you want line 84 of my code here it is:
  11. Nah, this is just a clean, i got confused by the brackets
    Dont use it: if ((args.length == 1) && ((args[0].equalsIgnoreCase("-s")) || (args[0].equalsIgnoreCase("silent")))) {
    Use it: if (args.length == 1 && (args[0].equalsIgnoreCase("-s") || args[0].equalsIgnoreCase("silent"))) {
    #11 DJgamer29, Jun 7, 2018
    Last edited: Jun 7, 2018
  12. That doesn't seem to be the issue, still doesn't work, here's the error when I try to plugman reload it:
  13. now
  14. Strahan


    Actually, his version was fine. It's the same as you wrote, just with unnecessary parenthesis bracketing. Also, an args length problem would not throw NPE, it would throw array index out of bounds.

    OP, just post the whole class already.
  15. edited, now waiting the answer from Dan
  16. Maybe when the plugin is reloading, the instance of plugin is disabled/null so commands cannot be registered?
    Try to make an instance, and use it.
  17. I don't think that's the problem, considering it works fine on other servers
  18. btw, why are u using plugman to reload? you should stop and start the server, the /reload and /plugman can bug some plugins. But if you can /plugman reload in another servers... that seems strange.
  19. I restarted when I put the plugins in