Error with plugin (Solved)

Discussion in 'Spigot Plugin Development' started by iTzXReplay, May 24, 2015.

  1. Hello, I am new to plugin development and I am playing around in java creating a plugin that tells everyone when a player joins the server. I have gotten the hang of some of it but I get a console error and the plugin doesn't work. Can someone look at the code and the crash and help me figure out what went wrong? Please remember I am new to this.
    Code

    Console Error
     
    #1 iTzXReplay, May 24, 2015
    Last edited: May 24, 2015
  2. Code (Text):
             pm.registerEvents(new Main(), this);
    Herein lies the problem. At this point your plugin (an instance of the Main class) is already running. If you're creating a second instance, you'll have the same plugin running twice, which is not appropriate. Hence, use

    Code (Text):
     pm.registerEvents(this, this);
    to register the events for your current instance (this).

    Also, please copy the callstack as text next time instead of using an image :)
     
  3. Thank you for the QUICK response time. It worked! Thanks
     
  4. Mark this thread solved