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

Events?

Comments in 'Plugin Development' started by jython234, Nov 5, 2013.

  1. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    We'll I want to use the player.chat event.
    How do you do it?
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Just add the event to your init:
    PHP:
    $this->api->addHandler("player.connect", array($this,"<FUNCTION NAME>"),50);
    And make a function to call with the name specified in the init, it could look like:
    PHP:
    public function eventHandle($event$data){
    //Some code here
    }

Share This Page

Advertisement