Build a server
UseGroundsServer.builder() from your application entrypoint.
start() calls build() and starts Minestom. Use build() in tests when you
need to inspect composition without starting a server process.
Discover providers
discoverProviders() scans the current thread context classloader with Java
ServiceLoader.
Discovery does not activate every provider. Select each required provider with
useProvider.Select a discovered provider
Select a provider by stable module ID:GroundsModuleProvider.id. A missing provider
fails before Minestom starts:
Use direct providers or modules
Useuse(provider) when the application creates a provider directly instead
of relying on ServiceLoader.
use(module) for a simple module that does not need descriptor metadata:
Configure the runtime
Without an explicitRuntimeConfig, the builder reads these environment
variables:
Set
GROUNDS_VELOCITY_FORWARDING_SECRET when proxy mode is velocity; the
runtime rejects forced Velocity mode without it.
Tests can supply configuration directly:
Startup and shutdown behavior
When the runtime starts, it:- resolves selected discovered providers;
- filters providers by server type;
- validates descriptors and service contracts;
- orders provider-backed modules by dependencies;
- initializes Minestom and calls
install(ctx)on every module; - starts Minestom on the configured host and port;
- calls
start()on every module.
stop() in reverse module order, runs registered shutdown
hooks in reverse registration order, then stops Minestom cleanly.
