1. Go to this page and download the library: Download nozell/commando library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nozell / commando example snippets
use CortexPE\Commando\BaseCommand;
use pocketmine\command\CommandSender;
class MyCommand extends BaseCommand {
protected function prepare(): void {
// This is where we'll register our arguments and subcommands
}
public function onRun(CommandSender $sender, string $aliasUsed, array $args): void {
// This is where the processing will occur if it's NOT handled by other subcommands
}
}
use CortexPE\Commando\args\RawStringArgument;
protected function prepare(): void {
// $this->registerArgument(position, argument object (name, isOptional));
$this->registerArgument(0, new RawStringArgument("name", true));
}