Mega Menus - Simple Menu API for Inventorys, Books and Chat

This is a discussion topic for the Ore project, Mega Menus. View the full project on Ore for downloads and more information.


Mega Menus

This menu API focuses on a fluent experience with redrawing inventories that do
not reset the cursor on every click
. A inventory menu with this API keeps the
player inventory unlocked and thus allowes for the inventory menu to accept and
output items in a controlled manner.

Command for Server Admins

If a player triggered the anti glitch system you can pardon them with
/megamenus pardon <PLAYER> (permission megamenus.command.pardon)
If you changed bits in the config you can reload it with
/megamenus reload (permission megamenus.command.reload)

If you don’t feel like typing megamenus, /mm is a command alias.

To be notified when players obtain glitched items (accident or not)
you can use the permission megamenus.antiglitch.notify.

A quick peek in the config:
You can change the behaviour of the anti-glitch system or turn it off in case it acts up and
change the default pagination icons for the menus.

Boring dev stuff

The API itself was influenced by java AWT/Swing but is Builder oriented.
Additionally the API will automatically generate pagination for menus with
elements put on different pages.

Default menu elements included are:

  • Icon - does nothing, but looks pretty
  • Button - has a click callback
  • Checkbox - can be toggled on and off, has a change callback, code can set tri-state
  • Spinner - add a list of values, has a change callback
  • Slot - can provide or accept single stacks of items (not shift-clickable), has a slot chagne callback

Additionally menus hold state objects for the menu and every player in the menu.
These objects do not reset automatically and are persistent until the menu is
GCed. Menus can be rendered as shared, potentially allowing multiple player to
interact on the same instance, or create a bound instance, that provides a
separate instance for all elements so interaction does not clash between
viewers.

All Elements on the menu render with Icons, collections of ItemStacks that
animates with a given FPS or frametime.

Please keep in mind that the menu has to be completely refreshed (recenter mouse cursor)
if the number of rows or the menu title changes throughout your menu structure.
This is a game limitation.

My Minesweeper plugin is a pretty good demo plugin to get things started

Depending on this plugin

This plugin is jitpack-compatible, if you’re using gradle just add this:

repositories {
    ...
    maven { url "https://jitpack.io" }
}
dependencies {
    ...
    compile 'com.github.DosMike:MegaMenus:master-SNAPSHOT'
}

You can view the JavaDocs here

External Connections

Version Checker
This plugin uses a version checker to notify you about available updates.
This updater is disabled by default and can be enabled in config/megamenus.conf
by setting the value VersionChecker to true.
If enabled it will asynchronously check (once per server start) if the Ore repository has any updates.
This will only print update notes into the server log, no files are being downlaoded!

Other Menu/GUI libraries

You might not like how I do things, and that’s ok. There are other great Menu Libraries on Ore:

Ordered alphabetically by plugin name, not by preference - Forgot a plugin? PM me on Sponge or tell me on my Discord.

Need Help?

Join my Discord

A new version has been released for Mega Menus, it is available for download here.


Added a WebAPI servlet
Added config for anti-glitch system

A new version has been released for Mega Menus, it is available for download here.


The menu system seems to be stable not, anti-glitch works, and I’m ok with the API design. Most stuff has JavaDocs attached, only the WebAPI needs review/testing.

JavaDocs can be downloaded from the Git release

A new version has been released for Mega Menus, it is available for download here.


  • Added PositionProviders for automatic element placement on pages
  • Fixed a bug with MSlots not carrying over event listeners
  • Tried to fix false detection of AntiGlitch System

A new version has been released for Mega Menus, it is available for download here.


  • Fix Issue #3
  • Fix some unreported NPE candiate
  • Improve PositionProviders
  • Allow customization of default Pagination Icons

A new version has been released for Mega Menus, it is available for download here.


  • Switched to gradle build system
  • This project is not jitpack compatible
  • Added VersionChecker
  • New ClearPage function for Menus (not removing pages)
  • Added Generics so event listeners need less casting
  • Removed Web-API code to be moved
  • Improved PositionProvider behaviour
  • Morer NPE fixes for mods with strange Inventory changes

Hello,
stupid question; Would this allow me to make a shop that has prices for say every item and be able to accept every item. but only be able to buy certain items i defined previously for the rest of the menu?

You mean like one slot where any item can be put in (sold) and the rest are buttons to buy items? if so, then yes.
This is a menu api and, as such, will not limit you on what MSlot elements do with items they received.

1 Like

Now to learn Java so i can make a menu with your plugin… lol

A new version has been released for Mega Menus, it is available for download here.


  • Fixed trying dropping menu elements banning players
  • Added KeyPress listeners on the way

A new version has been released for Mega Menus, it is available for download here.


  • PositionProvider can now actually be used (don’t set a position in the builder, or set the position to null before adding the element to a menu)
  • Improved MSlot / IInventory a bit: can now prefilter ItemStackSnapshots