Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[SOLVED][New-API] Events

Comments in 'Plugin Development' started by swagboy47, Jul 26, 2014.

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

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    hey guys i have a quick question , what event is when an event have happened , is it like this ?
    public function onEvent(Event $event){
    LDX likes this.
  2. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
    Still trying to manage all the events? xD
    PEMapModder likes this.
  3. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    yea , but i don't want to write all the events : P
  4. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
    But how do you plan users (who doesn't know how to code) will use it?
  5. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    that is on my TODO list next version , but let's get it to work first ;)
  6. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
    To make a plugin you should think if it will help to do something and who will use it...
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    There is no such event. Give up and shut up.
    Assume there is an event called EventTriggeredEvent. Then, what is the event to listen to when EventTriggeredEvent is triggered?
    Anyway, try to study HandlerList.php and see if you can find any useful functions.
    onebone likes this.
  8. Humerus
    Offline

    Humerus Staff Member Plugin Reviewer

    Joined:
    Aug 23, 2013
    Posts:
    114
    Plugins:
    1
    I wrote some code that analyzed all of pocketmine's events (at least I think so). The output can be found here:
    and the output can be used to create functions that handle every command (which I also did, but will allow you to figure that out :))
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    This does not cancel events for listeners of @ignoreCancelled false.

    P.S. Did you use the reflections to do it?
  10. Humerus
    Offline

    Humerus Staff Member Plugin Reviewer

    Joined:
    Aug 23, 2013
    Posts:
    114
    Plugins:
    1
    The topic was not about canceling events, but about catching all events. And nope, something much simpler :p
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Yes, but @swagboy47 is dreaming trying to create a plugin that blocks events from being called, which I doubt the possibility.
    LDX and TheRealJ2KK2J like this.
  12. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    i have found the answer :)
Thread Status:
Not open for further replies.

Share This Page

Advertisement