PHP: use pocketmine\console\ConsoleCommandSender; // the namespace changed with PM4 ... PHP: $this->getServer()->dispatchCommand(new ConsoleCommandSender($this->getServer(), $this->getServer()->getLanguage()), "say Hello World!"); The code above executes the command in console context (highest permissions), if you want to execute the command in the context of the player use this instead: PHP: $this->getServer()->dispatchCommand($player, "me Hello World!");