Skip to content
Zurück zum Blog
Minecraft Paper server plugin interface showing custom inventory GUI menu layouts

InvUI: Building Custom Minecraft Server GUIs Like a Pro

ice
ice
@ice
Updated
17 Aufrufe
TL;DR:InvUI is a Java library for building custom inventory-based GUIs on Paper servers. It handles paging, tabs, scrolling, animations, and events so you can focus on features instead of wrestling with Minecraft's raw inventory API. Perfect for plugin developers who want polished menus without boilerplate.
🐙 Open-source Minecraft project

NichtStudioCode/InvUI

A paper library for creating custom inventory-based GUIs.

⭐ 376 stars💻 Java📜 MIT
View on GitHub ↗

If you're running a Paper server and want your plugins to feel polished instead of janky, custom inventory-based GUIs are non-negotiable. InvUI is a Java library that lets you build them without drowning in boilerplate or wrestling with Minecraft's raw inventory API. You get clean, reusable components, event handling that actually makes sense, and support for animations and complex layouts.

What This Project Does

InvUI is a Paper server library designed to handle one specific problem: inventory-based GUIs for plugins. Instead of registering raw inventory listeners and doing half your logic inside click handlers, InvUI gives you a structure. You define a GUI window, add items and buttons with callbacks, and the library handles the repetitive stuff underneath.

It supports a wide range of inventory types beyond the basic chest. You're looking at chests, anvils, brewers, cartography tables, crafters, furnaces, grindstones, merchants, smithing tables, and stonecutters. Different games need different tools, and InvUI lets you pick the right container for what you're building.

What sets this apart from writing GUIs manually is the abstraction layer. Instead of thinking about slot numbers and click events, you think about components: buttons, inventories with special behavior, multi-page layouts. The library handles mapping that to Minecraft's constraints.


Why Server Developers Use This

Building a GUI the hard way means manually tracking item positions, writing click listeners, managing your own state, and dealing with all the edge cases Minecraft throws at you. You end up with spaghetti code that's hard to extend. InvUI trades that mess for a declarative approach.

The event system is where things get genuinely useful. You can define what happens on item clicks, set constraints on which items can go into specific slots (only allow certain item types), customize stack sizes per slot, and handle pre-update events. But this unlocks GUIs that feel responsive and intuitive instead of fighting the player.

Animation support is another win. You can create visual polish without writing frame-by-frame update logic. For anything from a simple loading spinner to animated menu transitions, InvUI handles the timing.

Plus, the library supports paged layouts for long lists, tabbed interfaces for organizing content, and scrollable areas. If you've tried building any of these manually in Minecraft plugins, you know it's tedious. Here it's built in.


Getting InvUI Into Your Project

Setup assumes you've got a Maven-based plugin project. First, add the XenonDevs repository to your `pom.xml`:

xml
<repository>
 <id>xenondevs</id>
 <url>https://repo.xenondevs.xyz/releases</url>
</repository>

Then add the dependency. Version 2.0.x supports Paper 26.1.2, and that's what you'll want if you're starting fresh. If you're stuck on older Minecraft versions (back to 1.14), version 1.49 has you covered.

xml
<dependency>
 <groupId>xyz.xenondevs.invui</groupId>
 <artifactId>invui</artifactId>
 <version>2.0.0</version>
</dependency>

If you're using Gradle instead (fair choice), the equivalent is obvious. Once you've got the dependency building, you're ready to start defining windows and items.


Core Features That Matter

GUI Types. InvUI ships with several layout patterns built in. A normal GUI is just a fixed grid. Paged GUIs let you chunk content across multiple screens with navigation buttons handled automatically. Scroll GUIs work like a vertical scrollbar for large lists. Tab GUIs organize content into separate views. Pick the one that matches what you're trying to build instead of reinventing pagination logic every time.

MiniMessage Support. Color codes in Minecraft plugins are a pain. InvUI has first-class support for MiniMessage, which means you can use clean syntax like `Hello` instead of Minecraft's legacy ampersand codes. Your item names and lore stay readable in code.

ItemBuilder for Localization. If your server runs in multiple languages (or you're planning to eventually), InvUI's ItemBuilder handles language swaps cleanly. Instead of hardcoding item names, you define them once and let the library handle translations. Thinking ahead on this stuff saves refactoring pain later.

Powerful Event System. You can attach click handlers to specific items, validate input before it lands in a slot, customize stack size limits per slot, and respond to pre-update events. This means your GUI can actually enforce rules instead of just looking pretty and letting players break everything.

Embeddable Inventories. This is one of those features that sounds boring until you actually need it. You can embed an inventory inside a GUI window and use it like a normal container. Want a crafting bench inside a larger menu? A player storage area? Now it works naturally.


Common Gotchas and How to Dodge Them

Version 2.0 is a breaking change from 1.49. It's a complete rewrite optimized for modern Paper, which means your old code won't compile. If you've got an existing plugin on 1.49, upgrading isn't trivial. But if you're starting fresh, just use 2.0.

The biggest surprise people run into: slot indexing. InvUI abstracts most of this, but you still need to understand how Minecraft maps inventory slots to a 9-column grid. The documentation covers it, but getting this wrong means buttons and items end up in weird places.

Event ordering matters. Item pre-update events fire before clicks are processed, and that distinction changes how you validate input. Read the docs carefully before you assume your event handler will always see the final state.

Animation performance can get weird if you're animating too many items at once or running update logic that's expensive. Keep animation callbacks lightweight and test on lower-end machines (or at least simulate it mentally).


Alternatives Worth Knowing About

There are other options out there. Some developers hand-roll GUIs using Minecraft's raw inventory listeners and skip the library entirely. That works if you want minimal dependencies, but you'll write a lot more code. Conversely, there are other GUI libraries for Paper, though InvUI's documentation and active maintenance make it a solid pick for new projects.

If you're building something super simple (a single chest menu with 5 buttons), the overhead of InvUI might feel overkill. For anything more complex, it pays for itself.

One note: if you're building GUIs for a network of servers with a custom protocol, you might want to look elsewhere. InvUI is firmly focused on single-server Paper plugins. It doesn't handle cross-server communication or proxy integration.


Beyond Basic Menus

Once you've got simple menus working, InvUI lets you build surprisingly sophisticated interfaces. Combine paged layouts with animations. Use tab GUIs to organize different sections of your plugin's configuration. Leverage the event system to build interactive tools (search menus, crafting benches, equipment managers).

The Minecraft Text Generator can help you craft fancy item names and lore formatting to use inside your GUIs. If you're serving multiple regions or languages, combine it with InvUI's ItemBuilder to localize everything consistently.

And if you're running a public server with multiple sites and game modes, you might also be managing DNS. The Free Minecraft DNS tool handles that side of things, so your players can connect to your server with a custom domain instead of an IP address.

The library is genuinely well-documented. That team maintains a full guide at xenondevs.xyz with examples, and the GitHub discussions channel is active. If you get stuck, you're not staring at skeleton code - you've got reference material.

Frequently Asked Questions

What Minecraft versions does InvUI support?
InvUI 2.0.x supports Paper 26.1.2 (current Java release). If you're running older servers, version 1.49 works with Minecraft 1.14.0 through 1.21.11. Choose 2.0 for new projects to get the latest features and optimizations.
Is InvUI free to use, and what's the license?
InvUI is completely free and open-source under the MIT license. You can use it in commercial server plugins without restrictions. The source code is available on GitHub, so you can modify and inspect it yourself.
Can I use InvUI with Spigot instead of Paper?
InvUI is specifically designed for Paper servers. While Spigot shares a lot of API compatibility, InvUI uses Paper-specific features and optimizations. You'll need a Paper-based server to use this library.
How do I handle item validation in InvUI GUIs?
InvUI's event system includes item pre-update events and inventory click events that let you validate input before it lands in a slot. You can customize maximum stack sizes per slot and restrict which item types are allowed in specific areas, keeping your GUI behavior controlled.
Does InvUI support animated GUIs and visual effects?
Yes. InvUI includes built-in animation support for item updates and layout transitions. You can create visual polish like loading spinners, animated menus, and frame-based updates without writing frame-by-frame logic yourself.