i need unregister one command to my server, but it not works. The result is: Code: Call to a member function unregister() on null My code is: PHP: $commands = ['plot', 'myplot'];foreach ($commands as $cmds) { $map = $this->getServer()->getCommandMap(); $map->getCommand($cmds)->unregister($map);} I use the 3.11.1 api version for 1.14 bedrock edition.
unregister code should be as follows: PHP: $commandMap->unregister($commandMap->getCommand("commandName"));
PHP: $commands = ['plot', 'myplot'];$map = $this->getServer()->getCommandMap();foreach ($commands as $cmd){ $map->unregister($map->getCommand($cmd));} According to what the others said, this should work.