I try to open Windows thank CustomUI with next command ?: /test Error: https://pastebin.com/7LZNvkHM Code: https://pastebin.com/2fupvdHN Line: $this->getServer()->getCommandMap()->register(Commands::class, new Commands($this));
The first argument to CommandMap::register() should be the fallback prefix that uses can type. For example, if two plugins both register the /info command, one with the prefix "foo" and one with "bar", the user can use both commands with /foo:info and /bar:info.
You cannot use onCommand() if you want to register a new command like that. You need to create a command classs and add all your command's code there.
I have true i can use public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args) : bool { $plugin = $this->getServer()->getPluginManager()->getPlugin("customuitest"); if($cmd->getName() == "test"){ UIAPI::showUIbyID($plugin, Loader::$uis['simpleUI'], $sender); } return true; } To show UI. M'y code work great