# Init your plugin

### There is 2 important points :&#x20;

* YML file requirement
* Your main class plugin

## YML File

To begin, you have to add Kap Easy Menu in your dependencies plugin. To do this you juste have to write these lines below :&#x20;

```yaml
depend:
  - KapEasyMenu
```

This line says that your plugin gonna init after Kap Easy Menu. This is made to do not have null pointer exception while your server is running.

## Main Class

Let's add a variable that contain the menu manager. You just have to follow the code below:&#x20;

{% code overflow="wrap" lineNumbers="true" %}

```java
import fr.kap35.kapeasymenu.Menu.GuiMenu;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class MyPlugin extends JavaPlugin {

    IGuiManager guiManager;

    @Override
    public void onEnable() {
        ...
        guiManager = ((KapEasyMenu)Bukkit.getServer().getPluginManager().getPlugin("KapEasyMenu")).getGuiManager();
        ...
    }

    public IGuiManager getGuiManager() {
        return guiManager;
    }

}
```

{% endcode %}

With this part of code you can now : create / add / open your own menus !
