Event/Listener Type Plugin

Discussion in 'Plugin Development' started by wickersty, Apr 16, 2012.

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

    wickersty

    Hi all,

    Would someone be kind enough to help explain or advise the correct/best way to create an API-type plugin whose job it is to alert other plugins about events?

    In other words, say I make Plugin A. Plugin A has some methods, like "notifySomethingHappened()".

    Then there is Plugin B which I didnt make. Plugin B wants to tell Plugin A to tell is whenever "notifySomethingHappened()" is called.

    How could I accomplish this?

    I've tried messing with some various approaches, but reached dead ends, and this is not something I've done before.

    Thanks!!

    wick
     
  2. Offline

    wickersty

    Thank you dadaemon. I wasn't aware that the new event system could do this as well.
     
  3. Offline

    acuddlyheadcrab

    Yup custom events are pretty easy actually. Just look at the source codes of Bukkit's events if you don't know where to start :)

    I can say that if you call an event when another event happens there's no easy way to cancel the original event from the called custom events
     
Thread Status:
Not open for further replies.

Share This Page