Solved onPlayerClickInventory Not working

Discussion in 'Plugin Development' started by IsThisDisplayed, Jun 13, 2018.

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

    IsThisDisplayed

    im tryna make a staff gui plugin, everything works until the code reads my onPlayerClickInventory..?
    It doesnt display any errors.. (i even copy and pasted it from a tutorial when it didnt work first.. still not working wokeMe Code:
    Code:
    @EventHandler
        public void onPlayerClickInventory(InventoryClickEvent e){
            if(e.getInventory().getTitle().equals("StaffGUI")){
                if(e.getCurrentItem().getItemMeta() != null){
                    if(e.getCurrentItem().getItemMeta().getDisplayName() != null){
                        if(e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.AQUA + "Vanish")){
                            //code
                            Player p = (Player) e.getWhoClicked();
                            p.sendMessage("DON'T STEAL MY APPLES!");
                            e.setCancelled(true);
                        }
                    }
                }
            }
        }
     
  2. Online

    timtower Ninja on the waves Moderator

  3. Offline

    IsThisDisplayed

    Let me open eclipse (i will edit this message in a second dw)

    Edit: @Everyone, Vote that im dumb please, I didnt register the events thanks you TimsTheTower
     
    Last edited: Jun 13, 2018
  4. Online

    timtower Ninja on the waves Moderator

    @IsThisDisplayed There is no vote anymore.
    Glad that you got it solved.
    Marked as solved.
     
    IsThisDisplayed likes this.
Thread Status:
Not open for further replies.

Share This Page