Solved InventoryClickEvent not working on some servers, but working on some others

Discussion in 'Plugin Development' started by Machine Maker, Jul 2, 2017.

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

    Machine Maker

    My plugin has an command which brings up a custom inventory. To make sure players cannot move the items out of the inventory, the plugin cancels the InventoryClickEvent if the Inventory name is the name of the custom inventory. Shouldn't be a problem right? Ok, so I test it on my server, (link to a video of me testing it) and it works just the way you would expect. Then, I send the plugin to the guy who requested it and he says that he can move the items in the custom inventory. He even removes all other plugins and can still move the items. And yes, I am definitely registering the event in the main class.

    Code for InventoryClickEvent
    Code:
    package me.x1machinemaker1x.bounty.events;
    
    import org.bukkit.ChatColor;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.inventory.InventoryClickEvent;
    
    public class InventoryClick implements Listener    {
      
        @EventHandler
        public void onInventoryClick(InventoryClickEvent e) {
            if (!e.getInventory().getName().equals(ChatColor.UNDERLINE + ChatColor.GOLD.toString() + "Active Bounties")) return;
            e.setCancelled(true);
        }
    
    }
    


    Nevermind. Sorry bout that. It turns out he wasnt updating the plugin correctly
     
    Last edited: Jul 2, 2017
Thread Status:
Not open for further replies.

Share This Page