want to call function with a event

Discussion in 'Plugin Development' started by Cat 700, Mar 15, 2020.

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

    Cat 700

    I want to call a function with a event but IDK what to set the variable to.

    Code:
    @EventHandler
        private void onClick(InventoryClickEvent event, String Name) {
            int crafting = event.getRawSlot();
         
            if (slots.contains(crafting)) {
                event.getWhoClicked().sendMessage(Name);
            } else if (crafting < mythicCrafter.CSize) {
            if (ChatColor.stripColor(event.getView().getTitle()).equals("Mythical Crafter")) {
            event.setCancelled(true);
            } else {
                return;
            }
            }
            }
    
    
        public void addRecipe() {
            InventoryClickEvent event = null;
            onClick(event, this.RName);
        }
     
  2. Online

    timtower Administrator Administrator Moderator

    @Cat 700 You do realize that events only take 1 parameter right?
     
  3. Offline

    Cat 700

    yes I realize now that it isn't really possible to even do this
     
Thread Status:
Not open for further replies.

Share This Page