Build a Paper plugin that provides a reusable custom inventory-GUI API for other Bukkit/Paper plugins. Create a polished, public Java API in a clearly named package (e.g. api package) for dependent plugins to construct and open GUI menus with configurable title/size, item slots, click handlers, and close handlers. Include a public plugin accessor/service entry point other plugins can discover via Bukkit's PluginManager and use safely. Handle GUI clicks/drag events so menu interactions are contained and handler callbacks are exposed cleanly; support opening menus for players and avoid memory leaks when menus close. Provide concise README/documentation with plugin installation, dependency usage, and a complete example of another plugin creating/opening a menu. Keep compatibility with the project’s configured Paper target and Java version; do not add unrelated gameplay features. Implement the code and metadata/resources needed for a working plugin.

Kodari AI
KodariOct 15 at 12:51 pm 1
CustomGUIFramework
A reusable Paper plugin providing a public custom inventory-GUI API for other Bukkit/Paper plugins. Offers a builder-based menu system with configurable titles, sizes, item slots, click handlers, and close handlers. Includes a service accessor for safe plugin discovery via Bukkit's PluginManager, centralized GUI management to prevent memory leaks, and comprehensive event handling for clicks and drags. Features lazy initialization for reliability, automatic cleanup on menu close, and a clean public API package for dependent plugins. Provides complete documentation with installation instructions, dependency setup, and a working example of another plugin creating and opening a menu. Designed for Java 8+ compatibility with Paper servers.
  1. Create the Paper 1.21.4 / Java 21 plugin project and metadata.

  2. Add a service-discoverable GUI API with menu, click, and close callbacks.

  3. Contain GUI clicks/drags, clean up closed menus, and document installation and use.

Created GuiKit, a Paper 1.21.4 / Java 21 plugin with a Bukkit service-discoverable GUI API. Menus support configurable titles and sizes, item slots, click handlers, and close handlers; menu clicks and drags into the GUI are contained, and closed menus are removed from the active registry.

Added README.md with installation steps, dependent-plugin setup, and a complete usage example.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
settings.gradle
Code
12 480
src/main/java/dev/kodari/guikit/GuiKitPlugin.java
package dev.kodari.guikit;

import dev.kodari.guikit.api.GuiApi;
import dev.kodari.guikit.api.GuiApiImpl;
import org.bukkit.Bukkit;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;

public final class GuiKitPlugin extends JavaPlugin {
    private GuiApiImpl api;

    @Override
    public void onEnable() {
        api = new GuiApiImpl(this);
        Bukkit.getPluginManager().registerEvents(api, this);
        Bukkit.getServicesManager().register(GuiApi.class, api, this, ServicePriority.Normal);
    }

    @Override
    public void onDisable() {
        if (api != null) {
            Bukkit.getServicesManager().unregister(GuiApi.class, api);
            api.shutdown();
        }
    }

    public GuiApi getApi() {
        return api;
    }
}