Which event cancelled ...

Discussion in 'Plugin Development' started by raum, Nov 12, 2014.

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

    raum

    I've got a small problem that I can't figure out. An event is being cancelled, but shouldn't be. It's not my plugin cancelling it, as I've added messages anywhere it gets cancelled.

    I can see all the plugins that monitor for the event and none of them should be ... but I don't see of any way to see which one is actually cancelling it. Is this possible?

    This is what I use to see all the plugins listening for the event:
    Code:
     if ( event.isCancelled() ) {
     RegisteredListener[] r = event.getHandlers().getRegisteredListeners();
     int num = 0;
     while ( num < r.length )
     {
     plugin.debug(r[num].getPlugin().getName() + 
     ": " + r[num].getPriority() );
     num++;
     }
        }
    
    Thanks!
     
  2. Offline

    Luke_Lax

    Ok.. What exactly is your question? You've told us it's not your code and it's not any plugins, so...
     
  3. Offline

    raum

    I didn't say it wasn't another plugin. It's obviously another plugin. My question was, as stated, "I don't see of any way to see which one is actually cancelling it. Is this possible?"
     
  4. Offline

    jensdeboom

    Set your events priority to Highest ( @EventHandler(priority = EventPriority.HIGHEST ) and check if it fixes the problem. If it does, it another plugin. If it doesn't, it's probably your plugin.
     
  5. Offline

    Skionz

    Just debug to find the plugin causing it.
     
  6. Offline

    raum

    I know it's another plugin. I'm trying to find out if there's a way to see WHICH plugin is doing it?
     
  7. Offline

    Skionz

    raum Debugging...
     
  8. Offline

    rsod

Thread Status:
Not open for further replies.

Share This Page