Solved One event not working but others in same class are

Discussion in 'Plugin Development' started by Lammazz, Feb 3, 2015.

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

    Lammazz

    In a class I have 2 events, one is a block break event and the other an inventory click. The inventory click event works fine but the block break event isn't even being fired. Both of them have @EventHandler on then and are being registered the same way.

    onEnable:
    Code:
    public static Main plugin;
    public void onEnable() {
    plugin = this;
    getServer().getPluginManager().registerEvents(Resources.getInstance(), plugin);
    }
    Event Class:
    Code:
    private Resources() { }
        private static Resources instance = new Resources();
        public static Resources getInstance() { return instance; }
    
    @EventHandler
        public void onResourceBreak(BlockBreakEvent e) {
    System.out.println("1");
    }
    
    @EventHandler
        public void onInvClick(InventoryClickEvent e) {
    //Inventory stuff I'm not showing
    }
    Turns out I was using world edit's super pick "//" and it wasn't calling the event... my bad

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  2. Offline

    1Rogue

    Protip: Be very wary of the plugins you allow into your testing environment.
     
Thread Status:
Not open for further replies.

Share This Page