-
Notifications
You must be signed in to change notification settings - Fork 1
Home
VGui is a Velocity library and standalone plugin for proxy-owned inventory screens. It opens container windows directly from the proxy, receives client clicks through PacketEvents, and keeps backend servers out of the menu lifecycle.
This Wiki documents the complete public API, deployment options, packet behavior, threading rules, build process, and common integration patterns.
| Goal | Page |
|---|---|
| Install VGui and open a first menu | Getting Started |
| Add VGui to Maven or Gradle | Installation |
| Understand views, contents, and context | Core Concepts |
| Build menus with every available view type | View Types and Builders |
| Design character-mask layouts | Layouts and Slots |
| Build items, skulls, buttons, and actions | Items and Skulls |
| Handle every click type | Click Handling |
| Change open menus and schedule updates | Contents and Updates |
| Store per-player state | Context and State |
| Open submenus and go back | Navigation |
| Build paged menus | Pagination |
| Collect text with an anvil | Anvil Input |
| Use lifecycle callbacks and global listeners | Lifecycle and Listeners |
| Copy complete examples | Examples and Recipes |
| Diagnose a failure | Troubleshooting |
VGui owns the top inventory of its proxy window. It assigns a proxy window id, sends the open-window packet, renders GUI items, decodes clicks, and restores the authoritative contents after cancelled client transactions. It also appends the tracked player inventory to full refresh packets so a GUI update does not visually clear the hotbar or main inventory.
The backend still owns the real player inventory. A default VGui view is a display-and-click interface, not a second inventory implementation. VGui cancels transactions so a client cannot move items into or out of the proxy GUI. If an integration disables cancellation, that integration is responsible for the resulting inventory behavior.
-
VGuiprovides static builders and delegates to the active service. -
VGuiServiceopens, replaces, closes, and queries views. -
Viewdescribes a reusable screen and its lifecycle. -
ViewBuildercreates immutableViewinstances without subclassing. -
ViewContentsis the mutable state of one player viewing one screen. -
ViewContextstores state associated with that open screen. -
ViewItemcombines a PacketEvents item stack with an optional click handler. -
ItemBuilderwrites modern item components and legacy NBT. -
ClickContextdescribes one click and exposes navigation and sound actions.
The generated API Javadocs provide signature-level documentation. This Wiki focuses on how the pieces work together.
Use the standalone VGui plugin for most networks. A dependent plugin declares the vgui plugin dependency and compiles against VGui with provided or compileOnly scope.
Shading is available for plugins that must be self-contained. Shaded integrations must relocate the VGui package and call the bootstrap lifecycle methods themselves. See Shading VGui.
The current source builds with Java 25 and Velocity 4.0.0. PacketEvents, Velocity, test, Maven plugin, and GitHub Actions versions are centralized and monitored by Dependabot. See Compatibility for the difference between a compiled path and a live-tested combination.
Some documentation was AI-assisted and may contain minor inaccuracies; please verify details before relying on it.- View Types and Builders
- Layouts and Slots
- Items and Skulls
- Click Handling
- Contents and Updates
- Context and State
- Navigation
- Pagination
- Anvil Input
- Lifecycle and Listeners
- API Reference