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

[NEW-API] Old run function

Comments in 'Plugin Development' started by YoDevil, Jul 14, 2014.

  1. YoDevil
    Offline

    YoDevil New Member

    Joined:
    May 12, 2014
    Posts:
    10
    Minecraft User:
    YoDevil
    Hi all, I'm trying to update my plugin to the new API.
    What would this became?
    PHP:
    $this->api->console->run("example"$player)
  2. YoDevil
    Offline

    YoDevil New Member

    Joined:
    May 12, 2014
    Posts:
    10
    Minecraft User:
    YoDevil
    I think I've got it by myself:
    PHP:
    $this->getServer()->dispatchCommand("example"$player);
    Would this work?
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Yes. But make sure it is $player or an instance of ConsoleCommandSender.
  4. YoDevil
    Offline

    YoDevil New Member

    Joined:
    May 12, 2014
    Posts:
    10
    Minecraft User:
    YoDevil
    My $player is actually a Player object from $event->getPlayer().
    What if instead I want the console to execute the command?

Share This Page

Advertisement