> 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/minigame-setup.md).

# Minigame setup

Every minigame must extend MiniGame class.

```java
public class MyMinigamePlugin extends MiniGame 
```

If you want to set configurators overwrite **loadConfigurators** method

<pre class="language-java"><code class="lang-java"><strong>    @Override
</strong>    protected ConfiguratorsInitializer loadConfigurators() {
        return ConfiguratorsInitializer.builder()
                .setGameConfigurator(new MyGameConfigurator())
                .setPluginConfigurator(new MyPluginConfigurator())
                .build();
    }
</code></pre>

If you want to set GameManager or loader, other manager or factory, overwrite **configure** method

Init your own Game Manager.

You must set your own game manager, to define joining, leaving and drawing game.&#x20;

```java
    @Override
    protected LibraryConfiguration configure() {
        commandsModule = new CommandsModule(this);
        return new LibraryConfiguration(this, getConfiguratorsInitializer())
                .builder()
                .setGameManager(new MyGameManager())
                .registerModules(commandsModule) 
                //new way how to register command module
                .build();
    }
```

If you want to use config.yml or other configuration YAML set it in **initConfiguration** method<br>

{% hint style="warning" %}
You must implement this method
{% endhint %}

```java
    @Override
    protected void initConfiguration() {
        getConfig().options().copyDefaults(true);
        saveConfig();
        //init your configuration classes 
    }
```

The whole implementation of the minigame main class

```java
public class MinigamePlugin extends MiniGame {

    @Override
    protected void onMiniGameEnable() {
        //define your on enable logic
    }
    
    @Override
    protected void initConfiguration() {
        getConfig().options().copyDefaults(true);
        saveConfig();
        //init your configuration classes 
    }
}
```
