Solved Need help with InventoryClickEvent

Discussion in 'Plugin Development' started by Keokix, Aug 17, 2019.

Thread Status:
Not open for further replies.
  1. Im making a Coinflip plugin for 2 players in with bukki in 1.4.7 for a server, but for some reasons the inventory clickeven is not getting activated even if its done correctly...it worked at one point but now its not working anymore even if i dont changed anything
    this is the event itsself, dont mind sort(); or colorid.add...
    Code:
        @EventHandler
        public static void onClick(InventoryClickEvent e) {
            Player p = (Player) e.getWhoClicked();
            if (e.getInventory().getTitle().equals("!Choose your color!")) {
                if(e.isRightClick() || e.isLeftClick()){
                    e.setCancelled(true);
                }
                colorid.add((short) e.getSlot());
                p.closeInventory();
                p.sendMessage(ChatColor.GREEN + "You created a challenge about " +  MavacsStupidCoinflip.money + "$!");
                sort();
    
            }
            if(e.getInventory().getTitle().equals("!Coinflip Challenges!")) {
                if(e.isRightClick() || e.isLeftClick()){
                    e.setCancelled(true);
                }
            }
        }
    
    
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Keokix Events are not static.
     
  3. Yeah but that wasnt the problem but i fixed it now :)
     
Thread Status:
Not open for further replies.

Share This Page