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

Error in eventHandler - public function init()

Comments in 'Plugin Development' started by SuperChipsLP, Nov 22, 2013.

  1. SuperChipsLP
    Offline

    SuperChipsLP Active Member Plugin Developer

    Joined:
    Sep 15, 2013
    Posts:
    204
    Plugins:
    5
    Minecraft User:
    Redmol
    Hey! This thingy

    PHP:
    $this->api->addHandler("player.move", array($this"eventHandler"), 100);
    gives me the following error:

    Code:
    2013-11-22 §b15:31:54§r [ERROR] A level 4096 error happened: "Argument 2 passed to PocketMinecraftServer::addHandler() must be callable, array given, called in C:\Users\Niklas_2\Documents\Programmierung\PocketMine\TestServer\Tutorial Server\PocketMine-MP\src\API\ServerAPI.php on line 315 and defined" in "C:\Users\Niklas_2\Documents\Programmierung\PocketMine\TestServer\Tutorial Server\PocketMine-MP\src\PocketMinecraftServer.php" at line 269
    whats the problem?
    I can't see it.

    Thanks!
  2. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    make sure that you got a function "eventHandler" and that it's public
  3. SuperChipsLP
    Offline

    SuperChipsLP Active Member Plugin Developer

    Joined:
    Sep 15, 2013
    Posts:
    204
    Plugins:
    5
    Minecraft User:
    Redmol
    Sure...

    PHP:
    public function eventHanlder($data$event)
  4. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    You spelled the function wrong
  5. SuperChipsLP
    Offline

    SuperChipsLP Active Member Plugin Developer

    Joined:
    Sep 15, 2013
    Posts:
    204
    Plugins:
    5
    Minecraft User:
    Redmol
    Thanks. Sorry for my stupid question! :p
    It is really hard to code when you are severely visually impaired...
    Jemrada likes this.

Share This Page

Advertisement