Skip to content

stack9/MenuAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MenuAPI

This plugin is for developers only, if you're a server owner then this isn't intended for you.

MenuAPI facilitates you the creation of menu through inventories. The process is really simple and the API contains some default classes to minimize the code you need to write.

The wiki isn't ready yet, so if you need to use a specific functionality check out the source code on GitHub.

Maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.stack9</groupId>
        <artifactId>MenuAPI</artifactId>
        <version>v1.4.1</version>
    </dependency>
</dependencies>

Gradle

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.stack9:MenuAPI:v1.4.1'
}

Usage

package me.example.project;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import it.stack9.menuapi.menu.*;

public class Example {
    public static void main(String[] args) {
        Player player = Bukkit.getServer().getOnlinePlayers()[0];
        
        Menu menu = MenuFactory.create("Test menu", Menu.CHEST_SIZE, new SimpleMenuListener() {
            @Override
            public void onSelect(Menu menu, Player player, Option selection) {
                player.sendMessage("You selected the option #" + selection.getId());
            }
        });
        
        menu.setOption(4, new Option(1, new ItemStack(Material.DIRT)));
        
        menu.open(player);
    }
}

About

API to create in-game menus

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages