PHP: $command = "a command";$this->getServer()->dispatchCommand(new ConsoleCommandSender($command)); What I'm missing? Output Code: Call to undefined method AndrOyuN\test\test\CommandTests::getServer()
PHP: $this->getServer()->dispatchCommand(new ConsoleCommandSender(), $command); Also, this is not your PluginBase
understood ^^ But now getting Code: Warning: Missing argument 2 for pocketmine\Server::dispatchCommand(), called in /home/ataberk/server/server/plugins/PhpProject1/src/AndrOyuN/test/test.php on line 76 and defined in phar:///home/ataberk/server/server/PocketMine-MP.phar/src/pocketmine/Server__64bit.php on line 1876 Notice: Undefined variable: commandLine in phar:///home/ataberk/server/server/PocketMine-MP.phar/src/pocketmine/Server__64bit.php on line 1877 [20:54:24] [Server thread/INFO]: Unknown command. Try /help for a list of commands output :/ Edit: code PHP: $command = "me sea"; $this->getServer()->dispatchCommand(new ConsoleCommandSender($command));