Create a new class and make it extend PluginCommand. Then, register it using the register method in CommandMap, which can be done withHello everyone! I want the command code of my plugin to be in a separate class. How can this be done correctly? I watched a lot of sources of different plugins, but could not figure out how to do it.
this.getServer().getCommandMap().register(Plugin, Command);
in your main class.Well, the familiar `setExecutor` method from the Spigot API. How to use it properly in Nukkit?Easiest way is to extend PluginCommand and use the onCommand method. Alternatively, you can also use setExecutor to specify a specific class to use.
Here is an example of separate command executorWell, the familiar `setExecutor` method from the Spigot API. How to use it properly in Nukkit?
the easiest way is to extend Command class. It's just and example from a bit more complex project.Difficult ... What is CommandBase for? Why CommandManager? No way easier? I apologize for such stupid and simple questions. Make command code in a separate class in Nukkit is a difficult task for me. :< ?