0

As of 1.13 of Minecraft (and im not sure when it came out for bedrock) they added in the "command ui" with syntax and autofilling for commands (see below)

Command Syntax

I know on java edition it is possible to hijack the "Command Context" functions to create custom syntax for a command but on Bedrock it seems to all be stuck as [args: text] Is there any way to change that?

1 Answers1

0

There is a very handy library/virion that handles all this for you. Take a look at https://github.com/CortexPE/Commando and if you need any examples you can look at https://github.com/CortexPE/Hierarchy. With this library you can add custom argument types.


<?php


namespace mohamed205\example\argument;


use CortexPE\Commando\args\StringEnumArgument;
use pocketmine\command\CommandSender;

class ExampleArgument extends StringEnumArgument
{
    protected const VALUES = [
        // put valid values for your argument here
    ];

    public function parse(string $argument, CommandSender $sender)
    {
        return $this->getValue($argument);
    }

    public function getTypeName(): string
    {
        return "exampleArgument";
    }
}
Mohamed
  • 94
  • 1
  • 10