Solved OnInventoryClick Event not working?

Discussion in 'Plugin Development' started by mcrazmouze, Sep 1, 2016.

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


    Why won't it send a message when i'm clicking in my inventory?

    package me.bukkit.melonos;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.inventory.InventoryClickEvent;
    public class Main extends JavaPlugin implements Listener {
        public void OnEnable() {
        getServer().getPluginManager().registerEvents(this, this);
        public void OnInventoryClick( InventoryClickEvent e ) {
            e.getWhoClicked().sendMessage("STOP CLICKING!");
  2. Offline


    Your method is named "OnEnable" not "onEnable", causing your event to never get registered. As a tip for the future. use the @Override annotation. This way your IDE will throw errors if you are not overriding a method.
Thread Status:
Not open for further replies.

Share This Page