🇱🇷
zMenu
Marketplace
English
English
  • 🍾Getting started
  • 🔌Installing zMenu
  • ➕Supported Plugins
  • 👍zMenu+
  • â›°ī¸Configurations
    • â„šī¸Informations
    • 📜Commands and Permissions
    • đŸĒ§PlaceHolder
    • How to create an inventory step by step
    • 👨‍đŸ’ģInventories
    • âšī¸Buttons
    • 🏁Requirements
    • â˜ĸī¸Actions
    • đŸĒItems
    • Global Placeholders
    • 🔋Patterns
    • Commands
    • 🛝Player data
    • đŸĻŦConfig.json
  • API
    • â„šī¸Informations
    • Create Button
    • Create Material Loader
    • Create ButtonOption
    • Load Inventory
    • Fast Events
  • đŸ—ƒī¸Plugin's files
  • 🕍Example GUI menus
  • Update to new API
Powered by GitBook
On this page
  • Maven
  • Gradle
  • First step
Edit on GitHub
  1. API

Informations

API Information

PreviousConfig.jsonNextCreate Button

Last updated 10 months ago

The zMenu API will allow you to create your own inventory and button. You can have the same configuration system for all your plugins.

Javadocs:

Example:

Last version here:

Maven

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

<dependencies>
	<dependency>
		<groupId>com.github.Maxlego08</groupId>
		<artifactId>zMenu-API</artifactId>
		<version>VERSION</version>
	</dependency>
</dependencies>

Gradle

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

dependencies {
		implementation 'com.github.Maxlego08:zMenu-API:VERSION'
}

First step

@Override
public void onEnable() {
    InventoryManager inventoryManager = getProvider(InventoryManager.class);
    ButtonManager buttonManager = getProvider(ButtonManager.class);
}

private <T> T getProvider(Class<T> classz) {
    RegisteredServiceProvider<T> provider = getServer().getServicesManager().getRegistration(classz);
    return provider == null ? null : provider.getProvider() != null ? (T) provider.getProvider() : null;
}

The first step is to get the and interface with the spigot service provider system.

â„šī¸
https://javadocs.groupez.dev/zmenu/index.html
https://github.com/Maxlego08/zMenuExample
https://github.com/Maxlego08/zMenu-API/tags
InventoryManager
ButtonManager