Relay is a command framework for Java, with a Paper platform module for Minecraft servers.
It is designed around three ideas:
- A clean, platform-agnostic command model
- A reusable parsing / matching / suggestion engine
- Thin platform adapters that expose the model naturally on specific runtimes such as Paper
Relay is not trying to be “just a command executor helper”. It is a structured command system with:
- typed arguments
- overloads / signatures
- subcommands
- flags and value options
- requirements / access checks
- help generation
- suggestion providers
- platform-specific authoring conveniences
The public API and shared abstractions.
This module contains the core contracts and model types such as:
CommandCommandDefinitionArgumentArgumentTypeCommandDispatcherCommandMatcherCommandRequirementCommandHelpProviderCommandResponseRenderer
If you are building on Relay as a library, this is the conceptual surface area.
The default implementation of the Relay API.
This module contains:
- default argument readers
- default parsers
- the default matcher
- the default dispatcher
- the default suggester
- default help provider / usage formatter
- the generic
CommandBuilder - default command and option implementations
This is the engine that makes the API useful.
The Paper platform adapter.
This module adds:
- Paper command manager
- lifecycle-based registration
- bootstrap support
- Paper-specific builder conveniences
- Paper-specific argument types
- Adventure / Paper rendering support
- Paper command contexts and handlers
This is the module consumer Paper plugins will use.
Relay is intentionally split into layers.
The command tree is represented as immutable command definitions and runtime command models.
A command can have:
- a name
- aliases
- subcommands
- signatures
- options
- requirements
- suggestion providers
Relay parses input using its own argument readers and parsers.
The matcher is responsible for:
- descending through subcommands
- parsing options
- choosing the best matching signature
- producing a
CommandMatchResult
The dispatcher:
- finds the correct root command
- parses the remainder
- checks requirements
- finds the bound handler
- executes the command
- returns a structured
CommandDispatchResult
Relay can generate structured help entries and usage lists from the command tree. Suggestions are produced using the command model, signatures, and registered suggestion providers.
A platform module takes the generic engine and exposes it in a platform-native way.
For Paper, that means:
- Paper lifecycle registration
- Paper command bootstrap support
- Paper-specific argument types such as players, worlds, materials, etc.
- Adventure component-based rendering