Hooking into MenuLib - SirCodalot/MenuLib GitHub Wiki

Adding MenuLib to Your Project

There are two ways to add MenuLib to your project:

Maven

work in progress

With the Jar File

Simply install the latest version from SpigotMC and add it to your project's libraries.

Setup MenuLib

Before you start working with the library you need to do a few things to make MenuLib work:

Hooking Into the Plugin

If you want to hook into the plugin, you need to add it to your plugin's dependencies. Simply add one of the following lines to your plugin.yml file:

depend: [MenuLib] # If your plugin needs MenuLib to work
softdepend: [MenuLib] # If your plugin can work without MenuLib

Setting Up the Library

If you chose to build the library with your project, you'll have to register an event listener to make the library work. Add this to your onEnable method:

// If you want to register the event in another class, you'll have to pass your main class' instance as a parameter.
new MenuListener(this);

Next Step

Try to compile and run your plugin. If everything works, you're ready to start making menus! Go to the next page to learn how to make menus with code.