Hello, how to register a command that is not written in the main.php file So Command has its own class. How do you register that because in the Main or in the plugin.yml
In the onEnable function of your main class (the one extending PluginBase): PHP: $this->getServer()->getCommandMap()->register("your plugin's name here", new ClassNameOfYourCommand($this)); In the constructor of your command class (that extends PluginCommand): PHP: public function __construct(Plugin $owner) { parent::__construct("command name here", $owner); $this->setDescription("Description here"); $this->setUsage("/command usage"); $this->setPermission("permission here");}