A modern and fluid library for creating menus (GUIs) in Minecraft Paper/Spigot plugins.
- Fluent API: Clear and readable syntax using builders
- Automatic Event Handling: No need to manually create listeners
- Dynamic Content Support: Items that automatically update
- Context System: Player-specific data handling
- Adventure API: Full support for modern text formatting
- Extensible: Modular design ready for future features
Add FastMenu as a dependency in your build.gradle:
repositories {
mavenCentral()
maven { url = 'https://jitpack.io' }
}
dependencies {
implementation 'com.darkbladedev:fastmenu:VERSION'
}- Build the project:
./gradlew build - Place the JAR inside your
plugins/folder - Restart the server
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
// Initialize FastMenu
MenuManager.initialize(this);
SchedulerUtil.initialize(this);
}
}Menu menu = MenuBuilder.create("my_menu", "§6My Menu", 3)
.setItem(13, new ItemBuilder(Material.DIAMOND)
.name("§bDiamond")
.lore("§7Click to receive a diamond!")
.onClick((player, click) -> {
player.getInventory().addItem(new ItemStack(Material.DIAMOND));
player.sendMessage("§aYou received a diamond!");
})
.build())
.setItem(22, new ItemBuilder(Material.BARRIER)
.name("§cClose")
.onClick(MenuAction.close())
.build())
.build();
// Open the menu
menu.open(player);Menu menu = MenuBuilder.create("shop", "§2Shop", 4)
.setItem(13, SimpleMenuItem.dynamic("balance", (player, context) -> {
int balance = getPlayerBalance(player); // Your method to get balance
return new ItemBuilder(Material.GOLD_INGOT)
.name("§6Your Balance")
.lore("§7Current balance: §6" + balance + " coins")
.build();
}))
.build();Menu menu = MenuBuilder.create("settings", "§cSettings", 3)
.setItem(11, SimpleMenuItem.dynamic("sounds", (player, context) -> {
boolean soundEnabled = context.getData("sound_enabled", Boolean.class, true);
return new ItemBuilder(soundEnabled ? Material.LIME_DYE : Material.GRAY_DYE)
.name(soundEnabled ? "§aSounds: Enabled" : "§cSounds: Disabled")
.onClick((p, click) -> {
boolean newState = !soundEnabled;
context.setData("sound_enabled", newState);
menu.refresh(p); // Refresh the menu
})
.build();
}))
.build();Check the ExampleMenu class in the examples package for complete implementations of:
- Main menu with navigation
- Shop with purchase system
- Player profile with dynamic statistics
- Settings menu with persistent toggles
create(id, title, rows)– Create a new buildersetItem(slot, item)– Set an item in a specific slotfillRow(row, item)– Fill a whole rowfillBorder(item)– Fill the menu borderonOpen(action)– Action triggered when opening the menuonClose(action)– Action triggered when closing the menubuild()– Build the final menu
name(text)– Set item name (supports MiniMessage)lore(lines...)– Add lore linesonClick(action)– Define click actionamount(count)– Set item amountenchant(enchantment, level)– Add enchantmentglow()– Add glowing effect
MenuAction.close()– Close the menuMenuAction.refresh()– Refresh the menuMenuAction.openMenu(menu)– Open another menuMenuAction.runCommand(command)– Run a commandMenuAction.sendMessage(message)– Send a message
- Paper API 1.21+
- Adventure API (included in Paper)
- Lombok (for development)
- Caffeine (for internal caching)
- PlaceholderAPI (optional)
MIT License – See the LICENSE file for details.
- Fork the repository
- Create a new branch for your feature (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push your branch (
git push origin feature/new-feature) - Create a Pull Request
- Issues: GitHub Issues
- Discord: DarkBladeDev