Skip to content

Documentation

Koboo edited this page May 14, 2025 · 5 revisions

Description

stomui is a flexible component-based inventory framework for Minestom.

Requirements

  • Minestom: 1.21.4
    • Snapshot-Version ebaa2bbf64
  • JDK: 21

Dependencies

stomui has only one dependency.

  • adventure-minimessage
    • Version: 4.18.0

Documentation

Installation

Repository

This library is hosted on maven central.

Note: You can find the latest version here.

Maven

Adding dependency in Maven:

<dependency>
    <groupId>eu.koboo</groupId>
    <artifactId>stomui</artifactId>
    <version>${version}</version>
</dependency>

Gradle

Adding dependency in Gradle (Groovy):

implementation "eu.koboo:stomui:${version}"

Getting started

To use stomui you have to create a ViewRegistry using the following calls:

// Creates a new ViewRegistry instance to use
ViewRegistry viewRegistry = MinestomUI.create();

// Registers the listeners of stomui on the Minestom Server
viewRegistry.enable();


// You could also disable the created ViewRegistry (e.g. on shutdown to cleanup safely)
viewRegistry.disable();

Create your first ViewProvider

If you want to open anything to a Player you have to create a ViewProvider first.

public class MyViewProvider extends ViewProvider {
  
  public MyViewProvider(ViewRegistry viewRegistry) {
    super(registry, ViewBuilder.of(ViewType.SIZE_6_X_9)
      .title("MyMiniMessageTitle"));
  }
}

Open your ViewProvider

Now you can create a new instance of MyViewProvider and open it to any Player.

ViewRegistry viewRegistry = YOUR_VIEW_REGISTRY_INSTANCE;
Player player = ANY_MINESTOM_PLAYER;

MyViewProvider myViewProvider = new MyViewProvider(viewRegistry);
myViewProvider.open(player);