-
Notifications
You must be signed in to change notification settings - Fork 1
Standalone Plugin
The standalone VGui jar is the recommended runtime model.
Velocity reads the filtered velocity-plugin.json from the jar. The descriptor identifies me.agent.vgui.core.VGuiPlatform as the entry point and records the Maven project version automatically.
The constructor receives:
ProxyServer- VGui's
PluginContainer - SLF4J
Logger - plugin data directory
During construction, VGui loads PacketEvents if no API singleton exists. During ProxyInitializeEvent, it initializes VGui and registers /vgui. During ProxyShutdownEvent, it closes sessions and performs owned PacketEvents cleanup.
The standalone artifact embeds the PacketEvents API, Velocity adapter, and common runtime modules that this bootstrap calls. PacketEvents' own plugin descriptor and Netty classes are excluded, leaving exactly one Velocity entry point and using the Netty version supplied by the proxy.
The runtime id is vgui. Dependent plugins must declare it:
@Plugin(id = "consumer", dependencies = @Dependency(id = "vgui"))/vgui opens a demonstration menu. The permission is vgui.demo.
The demo covers:
- character layouts
- item handlers
- pagination
- back navigation
- scheduled updates
- click sounds
- future-based anvil input
The command is intended for administrators and developers, not as an end-user interface.
The standalone jar builds the embedded PacketEvents API using VGui's plugin container and data directory, and owns that API's lifecycle. Reuse in a shaded integration is possible only when both integrations intentionally share the same API classes and class loader. A separately loaded, unrelocated PacketEvents copy is not assumed to be the same singleton; test any such coexistence before production.
The data directory is passed to PacketEvents when VGui creates the API. VGui itself currently has no user configuration file or persistent menu data.
- Download the latest stable vgui.jar.
- Stop the proxy.
- Replace the old jar.
- Start the proxy and inspect startup logs.
- Test menus with the client and backend versions used by the network.
Do not hot-reload proxy plugins. Plugin lifecycle, PacketEvents listeners, and network state require a normal restart.
Stop the proxy, remove vgui.jar, and remove or update plugins that declare the vgui dependency. A dependent plugin will not load successfully without its required runtime dependency.
After startup:
- confirm VGui initialized in logs;
- confirm dependent plugins loaded after VGui;
- run
/vguiwith permission; - open and close the demo;
- confirm backend inventory remains visually intact;
- test a server switch while a view is open;
- check logs for callback or packet errors.
The download name stays vgui.jar. Inside the jar, velocity-plugin.json and META-INF/MANIFEST.MF contain the actual project version. This allows dynamic latest-release links without losing runtime version diagnostics.
- 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