-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Simple menus is a simple library to easily build and use menus as well as paginated menus in your minecraft plugin. It supports 1.8 - 1.17 (tested and written in 1.17/latest ver) and has a separate module with support for adventure components.
First of all we have to add the dependency. There are a couple ways of doing this.
First of all add the nRepo
to your maven repositories. To do this add the following to your pom under the repositories
tag.
<repository>
<id>nRepo-releases</id>
<name>nRepo</name>
<url>https://mvn.nucker.me/releases</url>
</repository>
Next add the dependency under the dependencies
tag:
**Replace [VERSION] with the tag from the latest release
<dependency>
<groupId>wtf.nucker</groupId>
<artifactId>SimpleMenus-spigot</artifactId>
<version>[VERSION]</version>
</dependency>
Should be fairly self-explanatory
maven {
maven("https://mvn.nucker.me/releases")
}
implementation("wtf.nucker:SimpleMenus-spigot:[VERSION]")
If your plugin is running on paper and version 1.16 or above, you can use the built in adventure support. Simply change the artifact to SimpleMenus-adventure
. This will not run on servers running below 1.16 and not on paper.
Menu menu = new Menu(3 /* The amount of rows on the menu (slots / 9)*/, "&0Title" /* Title, supports color codes. Place component here if using adventure */, true /* Cancel clicks or not (leave blank for default: true) */
menu.addItem(new ItemStack(Material.GRASS)); // Adds it to the next available slot
menu.addButton(new Button(new ItemStack(Material.DIRT)) {
@Override
public void onClick(InventoryClickEvent event) {
System.out.println("Button clicked");
}
}