# What is module ?

The module is a separated JAR which adds more functions to **core library.**

Module must be **shade** in your plugin JAR, thanks to maven or gradle.

Every module must be registered in **configure** method in your Main class.



## How to register module?

Module can be registered in two ways.

1. Simple module registration, by put new instance of module to **registerModules** method&#x20;
2. Load before others modules, but put new instance of module in to constructor of LibraryConfiguration class.

The first way:

```java
    @Override
    protected LibraryConfiguration configure() {
        return new LibraryConfiguration(this, getConfiguratorsInitializer())
                .builder()
                .setGameManager(new MyGameManager(this, settings, messages))
                .registerModules(new MyModule(), new MySecondModule())
                .build();
    }
```

The second way:

{% hint style="danger" %}
This way to register module, must be used rarely, only in exceptional situations.
{% endhint %}

<pre class="language-java"><code class="lang-java"><strong>    @Override
</strong>    protected LibraryConfiguration configure() {
        commandsModule = new CommandsModule(this);
        return new LibraryConfiguration(this, getConfiguratorsInitializer()
                , Arrays.asList(new MyModule(), new MySecondModule()))
                .builder()
                .setGameManager(new MyGameManager(this, settings, messages))
                .build();
    }
</code></pre>
