Solved Parent Event?

Discussion in 'Plugin Development' started by sooon_mitch, Jan 27, 2016.

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

    sooon_mitch

    Is there an event that is called whenever any event is called? Sorta like a preEvent? I need a way of calling code to check something before any event is called.
     
  2. Offline

    Zombie_Striker

  3. Offline

    sooon_mitch

    @Zombie_Striker I was afraid someone was going to take this the wrong way. Let me give an example. For every event possible in Bukkit I need to check if an a variable is null. I do not want to declare every single event handler in my code, instead I was hoping that there was a master event or preevent that is called when any event is called. So instead of checking inside of each event separately, I could check in one single event.
     
  4. Offline

    Zombie_Striker

    @sooon_mitch
    Sadly, I do not think there is such an event. You can try simply using "Event" or "PlayerEvent", but I do not think they contain any important information.
     
  5. Offline

    sooon_mitch

    @Zombie_Striker Can you expand more on the "Event" event?

    Maybe a Javadoc link? I cant seem to find it there.


    (merged by moderator: please use the edit button instead of making multiple posts back to back)
     
    Last edited by a moderator: Jan 27, 2016
  6. Offline

    adam753

    @sooon_mitch
    Make an EventHandler method where, instead of being PlayerInteractEvent for example, it's just Event. All events inherit Event so you'll get all events that way.
    I've no idea if it'll work or not.
     
  7. Offline

    sooon_mitch

    I believe this will do. Thank you all.
     
  8. Offline

    teej107

Thread Status:
Not open for further replies.

Share This Page