title: Bukkit event InventoryClickEvent doesn't work
body: <p>I want to make a GUI (a one-line inventory) with a diamond inside. But when  click on the diamond, nothing seems to happen. I'm pretty sure it's the <code>GuiCommand#onInventoryClick(InventoryClickEvent e)</code> or just the <code>InventoryClickEvent</code> that doesn't work. Can anyone help ?</p>
  <p>This is my code:</p>
  <pre class="lang-java prettyprint-override"><code>package net.itrature.guiplugin.commands;
  
  import org.bukkit.Bukkit;
  import org.bukkit.ChatColor;
  import org.bukkit.Material;
  import org.bukkit.command.Command;
  import org.bukkit.command.CommandExecutor;
  import org.bukkit.command.CommandSender;
  import org.bukkit.entity.Player;
  import org.bukkit.event.EventHandler;
  import org.bukkit.event.Listener;
  import org.bukkit.event.inventory.InventoryClickEvent;
  import org.bukkit.inventory.Inventory;
  import org.bukkit.inventory.ItemStack;
  
  public class GuiCommand implements CommandExecutor, Listener
  {
      private Inventory inv;
      
      @Override
      public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
      {
          if (!(sender instanceof Player)) return true;
          if (args.length != 0) sender.sendMessage(ChatColor.RED + &quot;Usage: /gui&quot;);
          
          inv = Bukkit.createInventory(null, 9);
          inv.setItem(4, new ItemStack(Material.DIAMOND));
          
          ((Player) sender).openInventory(inv);
          
          return true;
      }
      
      @EventHandler
      public void onInventoryClick(InventoryClickEvent event)
      {
          // Testing if the diamond is clicked
          if (event.getInventory() == inv &amp;&amp; event.getCurrentItem().getType() == Material.DIAMOND)
              event.getWhoClicked().sendMessage(&quot;Diamond clicked!&quot;); // Never occurs
      }
  }
  
  </code></pre>
  <p>This is my main class:</p>
  <pre class="lang-java prettyprint-override"><code>package net.itrature.guiplugin;
  
  import org.bukkit.plugin.java.JavaPlugin;
  
  import net.itrature.guiplugin.commands.GuiCommand;
  
  public class GuiPlugin extends JavaPlugin
  {
      private static GuiPlugin plugin;
      
      @Override
      public void onEnable()
      {
          if (plugin != null) getLogger().warning(&quot;Plugin loaded twice!&quot;);
          else plugin = this;
          
          getCommand(&quot;gui&quot;).setExecutor(new GuiCommand());
          
          getLogger().info(&quot;Plugin enabled!&quot;);
      }
      
      @Override
      public void onDisable()
      {
          plugin = null;
          
          getLogger().info(&quot;Plugin disabled!&quot;);
      }
  }
  </code></pre>