Coul anyone tell me why it isnt working?

Discussion in 'Plugin Development' started by MarckF, Jul 29, 2015.

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

    MarckF

    Well, i code it, but when i load it on my server (no errors) when i right click nothing happens, the potion effect nor the message, what i am doing wrong?

    http://pastebin.com/RGFAaEZ0
     
  2. Offline

    khave

    You aren't registering your event.
     
  3. Offline

    SuperSniper

    @MarckF You need to register your events inside your onEnable() method.

    Bukkit.getServer().getPluginManager().registerEvents(this, this);
     
  4. I don't know why so many people make this "mistake", but Bukkit.getServer(). is so useless. All methods from the class Bukkit are static and access the methods directly from .getServer().
    It is just a waste of time (so many seconds lost in your life xD).

    Example code directly copied from decompiled craftbukkit's Bukkit.java class:
    Code:
     public static PluginManager getPluginManager()
      {
        return server.getPluginManager();
      }
     
  5. Offline

    Ruptur

    @SuperSniper
    Dont use Bukkit.getServer() since JavaPlugin class already has the method getServer()
    EDIT: Ninja'd by FisheyLP :)
     
  6. Offline

    MarckF

    thank you all, its now working
     
  7. One little suggestion: Don't log when your plugin enables/disables. Bukkit already logs load,enable & disable messages for every plugin. You are just useless spamming the console with those messages.
     
Thread Status:
Not open for further replies.

Share This Page