@EventHandler
    public void onInvClick(InventoryClickEvent event) {
        HumanEntity human = event.getWhoClicked();
        if (human instanceof Player) {
            Player player = (Player) human;
            Inventory inv = player.getOpenInventory().getTopInventory();
            if (inv.getHolder() != null && inv.getHolder() instanceof InventoryMenu && event.getRawSlot() >= 0 && event.getRawSlot() < this.getSize()) {
                InventoryMenu menu = (InventoryMenu) inv.getHolder();
                if (menu.getId() == this.getId()) {
                    event.setCancelled(true);
                    MenuIcon icon = slots.get(event.getSlot());
                    if (icon != null) {
                        icon.onClick(player);
                        player.closeInventory();
                    }
                }
            }
        }
    }