Menu System
Build paginated, bordered, interactive GUIs with buttons
Unify's menu framework supports multiple menu types, animated buttons, interactive slots, and pagination — all with minimal boilerplate.
Menu Types
Built-in Buttons
| Button | Purpose |
|---|---|
BackButton(menu) | Opens a previous menu |
GlassButton() | Decorative border filler |
CloseButton() | Closes the inventory |
AnimatedButton | Button with frame animation |
InteractiveSlotButton | Slot in InteractiveMenu |
Menu Properties
class MyMenu : Menu("Title") {
init {
autoUpdate = true // Refresh buttons automatically
autoUpdateInterval = 500L // Milliseconds between updates
updateAfterClick = true // Refresh after any click
fillBackground = true // Fill empty slots with glass
placeholder = true // Use placeholder items
nonCancelling = false // Cancel click events (default: true)
manualClose = true // Allow manual closing
}
}Menu Lifecycle
| Phase | Method |
|---|---|
| Open | menu.openMenu(player) |
| Close | menu.onClose(player) |
| Update | menu.updateButtons() |
| Destroy | menu.closed = true |
Next Steps
- Combine menus with Scheduling for animated updates
- Use Items for complex button item stacks
- Hook menus to Commands for
/menucommands