A simple and lightweight Minecraft GUI API for developers to use.

Overview

Current Version: 1.0.0

Requirements:

- You must be using PaperMC or a fork of it (This will not work with just Spigot/Bukkit!
- Curently this API only supports servers running 1.18.1+ (This version limit should be lowered in the near future)

StaticStudios-StaticGUI

A simple and lightweight Minecraft GUI API for developers to use.

Not a developer but a server owner? Don't worry, there is a configurable plugin that makes use of this API and allows you to easily create GUIs using only yml files, you don't have to understand code to use it!

Check it out: https://github.com/Sammster10/StaticStudios-GUIPlugin

Here are some examples of how to use this API:

Example 1, using the StaticGUI class:

Everything is defined in the constructor and there is only ever one instance of this menu. You should only use the StaticGUI class if there will only ever be one instance of the GUI.

public class ExampleStaticGUI extends StaticGUI {

    public final StaticGUI gui = new ExampleStaticGUI();

    private ExampleStaticGUI() {
        super(9, "Example GUI!");
        setItem(0, createButton(Material.DIAMOND, "I am a normal button",
                List.of("lore line 1!", "lore line 2!!"), (_player, clickType) -> {
            _player.sendMessage("You clicked this button with the click type: " + clickType.name());
        }));
        setItem(1, ench(createButton(Material.DIAMOND, "I am a normal button but I am enchanted!",
                List.of("lore line 1!", "lore line 2!!"), (_player, clickType) -> {
                    _player.sendMessage("You clicked this button with the click type: " + clickType.name());
                })));
        for (int i = 2; i < 9; i++) addItem(createGrayPlaceHolder("I am a placeholder"));
        setOnCloseRun((_player, clickType) -> {
            _player.sendMessage("You closed a menu, the click type, 'clickType' in this case, will always be null when an on close event is run");
        });
    }
}

Example 2, using the GUICreator:

It is recommended to use the GUICreator instead of the StaticGUI class however both can be used. It is optional to extend GUIUtils however it makes the code cleaner when defining placeholders.

public class ExampleGUICreator extends GUIUtils {

    public static void openMainMenu(Player player) {
        GUICreator c = new GUICreator(9, "This gui was created using the GUICreator class!");
        //c.setDestroyOnClose(true); you should avoid making this call (in most cases) as it will keep ths GUI in memory
        //forever. It is set to false by default. Whenever a menu is closed, it is destroyed (taken out of memory) by default.
        //If you want it to not be destroyed, maybe consider using StaticGUI (applicable in most cases)
        c.setItems(
                c.createButton(Material.EMERALD, "Your IGN is: " + player.getName(), List.of("I am lore!"), (_player, clickType) -> {
                    _player.sendMessage("You clicked a button!");
                }),
                ench(c.createButton(Material.EMERALD, "Your IGN is: " + player.getName(), List.of("I am an enchanted button!"), (_player, clickType) -> {
                    _player.sendMessage("You clicked a button!");
                }))
        );
        c.setOnCloseRun((_player, clickType) -> {
            _player.sendMessage("You closed the example menu, have fun making your own!");
        });
        c.open(player);
    }
}

To make a player open one of the above menus, do the following:

  ExampleStaticGUI.open(player);
  ExampleGUICreator.openMainMenu(player);

How to integrate this into your project(s):

  1. Make sure that maven is installed
  2. Clone this repository
  3. Open a command prompt/terminal and cd to this project's home directory (the directory which has the src folder, the .gitignore, ect...)
  4. Run the following command: mvn install
  5. The project has now been installed in your local maven repository, you can now add the following to your pom.xml to use this as a dependency:
    <dependencies>
        <dependency>
            <groupId>net.staticstudios</groupId>
            <artifactId>static-gui</artifactId>
            <version>[VERSION]</version>
        </dependency>
    </dependencies>
  1. Replace [VERSION] with the version specified at the top of this document
  2. In your main class's onEnable method, add the following line to enable the API: StaticGUI.enable(this);

Support Discord:

https://discord.gg/9S6K9E5

You might also like...

Community-Driven Game Server Development solution for Java Developers based on DEEPINTHINK MagOKO Project.

MagOKO Stack Community-Driven Game Server Development solution for Java Developers based on DEEPINTHINK MagOKO Project. License Copyright 2021-present

Jun 1, 2021

Java based open source static site/blog generator for developers & designers.

JBake JBake is a Java based open source static site/blog generator for developers. Documentation Full documentation is available on jbake.org. Contrib

Dec 30, 2022

My solutions for the MongoDB for Java Developers course

Welcome to M220J Disclaimer: The dependencies and versions in this project are not maintained. This project is intended for educational purposes and i

Jun 26, 2022

Alibaba Cloud Dedicated KMS Transfer SDK for Java can help Java developers to migrate from the KMS keys to the Dedicated KMS keys.

Alibaba Cloud Dedicated KMS Transfer SDK for Java Alibaba Cloud Dedicated KMS Transfer SDK for Java can help Java developers to migrate from the KMS k

May 12, 2022

Java SQL (JDBC) code generator with GUI. SQL and OOP finally united.

Java SQL (JDBC) code generator with GUI. SQL and OOP finally united.

jSQL-Gen Java SQL (JDBC) code generator with GUI. SQL and OOP finally united. Usage Install the latest release. Create a database, tables and their co

Nov 14, 2022

Classpy is a GUI tool for investigating Java class file, Lua binary chunk, Wasm binary code, and other binary file formats.

Classpy is a GUI tool for investigating Java class file, Lua binary chunk, Wasm binary code, and other binary file formats.

Classpy Classpy is a GUI tool for investigating Java class file, Lua binary chunk, Wasm binary code, and other binary file formats. Inspiration This t

Dec 17, 2022

Drifty is an open-source interactive File Downloader system built with java. It is currently available in CLI mode and has the GUI version under active development.

Drifty is an open-source interactive File Downloader system built with java. It is currently available in CLI mode and has the GUI version under active development.

Drifty Drifty is an open-source interactive File Downloader system built using Java. It takes the link to the file, the directory where it needs to be

Dec 24, 2022

Lightweight and Necessary utilities for mini minecraft server

Lightweight and Necessary utilities for mini minecraft server

WithMyFriends Lightweight server tools for minimal servers. Contributing to us Version Strategy Why? Despite a huge amount of Server Essential Plugins

Mar 4, 2022

DatasetCreator is a lightweight RESTFul client implementation of the Salesforce CRM Analytics External Data API.

DatasetCreator is a lightweight RESTFul client implementation of the Salesforce CRM Analytics External Data API. It has been deliberately developed with no 3rd party jars with the goal of being a lean, reliable and scalable solution.

Dec 16, 2022
An easy-to-use Spigot library that implements a GUI interface within offhand maps.

MiniMapGUI An easy-to-use Spigot library that implements a GUI interface within offhand maps. Maven/Gradle Dependencies Replace Tag with the latest ve

byteful 10 Oct 17, 2022
A powerful API whichs allows developers to change a players name and UUID on login.

UUIDSwitcher An easy to use but powerful API for spigot servers which gives developers control over the UUID and name a player logs in with. This chan

BeefDev 6 Nov 30, 2022
Features useful for Minecraft content developers.

Easy Development A mod to make Minecraft content development easier. Includes features primarily to assist with mod, resource pack, and datapack devel

null 2 Feb 15, 2022
The Download Manager uses a simple yet effective GUI interface built with java’s Swing libraries

The Download Manager uses a simple yet effective GUI interface built with java’s Swing libraries.The use of Swing gives the interface a crisp, modern look and feel. The GUI maintains a list of downloads that are currently being managed.

Manish Kumar Mahawar 2 Jan 2, 2022
A compact and highly efficient workflow and Business Process Management (BPM) platform for developers, system admins and business users.

Flowable (V6) Maven Central: Docker Images: License: Homepage: https://www.flowable.org/ flowable / flowəb(ə)l / a compact and highly efficient workfl

Flowable 6k Jan 7, 2023
A distributed lock that supports the use of Redis and Zookeeper, out of the box, fast and easy to use

lock-spring-boot-starter A distributed lock that supports the use of Redis and Zookeeper, out of the box, fast and easy to use 一款基于 Redis 和 Zookeeper

Pear Stack 9 Oct 15, 2022
These samples explore the different options that Spring Boot developers have for using Javascript and CSS on the client (browser) side of their application.

Table of Contents Getting Started Narrowing the Choices Create a New Application Webjars Show Me Some Javascript Normalizing Resource Paths Adding Tab

Dave Syer 18 Jul 29, 2022
This is a Maven plugin designed to help developers automatizing the creation of code classes from YML files based on AsyncApi and OpenAPI.

SCS MultiApi Maven Plugin This is a Maven plugin designed to help developers automatizing the creation of code classes from YML files based on AsyncAp

Corunet 0 Dec 20, 2022
RR4J is a tool that records java execution and later allows developers to replay locally.

RR4J [Record Replay 4 Java] RR4J is a tool that records java execution and later allows developers to replay locally. The tool solves one of the chall

Kartik  kalaghatgi 18 Dec 7, 2022
Simple and lightweight application which is checking status of your web services and send a notification if it is down.

rose-uptimer Simple and lightweight application which is checking status of your web services and send a notification if it is down. Example configura

RoseSapphire 3 Sep 25, 2022