> For the complete documentation index, see [llms.txt](https://timsixths-plugins.gitbook.io/minigameapi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://timsixths-plugins.gitbook.io/minigameapi-docs/2.0.0-beta1/basic-features/commands-deprecated/sub-commands.md).

# Sub commands

Every sub-command must be registered in the parent command class.

Every sub-command must implement SubCommand interface.

The sub-command has two methods:

* executeCommand - executes subcommand
* getName - gets sub-command name

The whole implementation of the sub-command class.

```java
public class MySubCommand implements SubCommand {

    @Override
    public boolean executeCommand(CommandSender sender, String[] args) {
        Player player = (Player) sender;

        player.sendMessage("my sub command");
        
        return false;
    }

    @Override
    public String getName() {
        return "mysubcommand";
    }
}
```
