Hey guys, So today @SOFe was talking about the way to make autocompletion, and basically the way to make commands work as vanilla, with syntax checking. So I started just trying things out, and messing with it, and found a way it works. This is the final code I came up with to make the syntax checking work and the arguments correctly: PHP: // Class that extends pocketmine\command\PluginCommandpublic function generateCustomCommandData(Player $player) { $commandData = $this->commandData; $commandData["overloads"]["default"]["input"]["parameters"] = [ 0 => [ "type" => "string", "name" => "parameter", "optional" => false ], 1 => [ "type" => "rawtext", "name" => "value", "optional" => true ], 2 => [ "type" => "string", "name" => "name", "optional" => true ] ]; return $commandData;} Now, even though this works flawlessly, there's something I could not figure out. I'm trying to make it so available subcommands and parameters to use show up above the typing bar, in chat. Basically, the actual autocompletion part. I'm not sure how I would go around doing this. I've tried adding things to the array of the input parameters above, for example "args" holding an array with the possible arguments, and options... I don't know how I would do it, that's for sure. I hope anybody has messed around with this enough to provide me with an answer for this question. Thank you in advance!
There is none for me, but it's because the function overwrites this one: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/command/Command.php#L106
The function is actually meant to use Player to get the player's permissions. Based on that, it'll sort out the availabe commands packet rather than sending all registered commands to players.
You forgot about the aliases. Better get the base data to edit from parent::generateCustomData($player) rather than $this->commandData.
As a matter of fact it doesn't have to extend PluginCommand. I'm adding this to https://bit.ly/PmDev That's called overloads. See this gist by @gurun for details: Spoiler: Gist