Why don't you add args for the commands ? For example using this code: PHP: declare(strict_types=1);namespace pocketmine\command\defaults;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\command\utils\InvalidCommandSyntaxException;use pocketmine\lang\TranslationContainer;use pocketmine\network\mcpe\protocol\AvailableCommandsPacket;use pocketmine\network\mcpe\protocol\types\CommandParameter;use pocketmine\Player;use pocketmine\utils\TextFormat;use function array_shift;use function count;class OpCommand extends VanillaCommand{ public function __construct(string $name){ parent::__construct($name, "%pocketmine.command.op.description", "%commands.op.usage", [], [ [ new CommandParameter("player", AvailableCommandsPacket::ARG_TYPE_TARGET, false) ] ]); $this->setPermission("pocketmine.command.op.give"); } public function execute(CommandSender $sender, string $commandLabel, array $args){ if(!$this->testPermission($sender)){ return true; } if(count($args) === 0){ throw new InvalidCommandSyntaxException(); } $name = array_shift($args); $player = $sender->getServer()->getOfflinePlayer($name); Command::broadcastCommandMessage($sender, new TranslationContainer("commands.op.success", [$player->getName()])); if($player instanceof Player){ $player->sendMessage(TextFormat::GRAY . "You are now op!"); } $player->setOp(true); return true; }} In the OpCommand.php instead of using the current one
I mean when you type the command in the chat it says [unknown:args] so why don't they put the args here for example: the /op command The args are /op {player: target} I don't think I explained it well but here is an image that describes what I mean
We have been planning for a new command API that allows commands to declare their arguments, but that would be an API-breaking change, and we haven't reached consensus how to implement this yet.
The proposed code adds zero value and tethers the commands API to the protocol. It is simply cosmetic and does not solve any of the actual issues which plague the commands API.