Context parameters
Context resolvers allow for dynamic resolution of context-specific values into command parameters, enabling commands to adapt based on the environment or actor state.
Overview
ContextParameter Interface
@FunctionalInterface
public interface ContextParameter<A extends CommandActor, T> {
/**
* Reads input from the given {@link MutableStringStream}, parses the object, or throws
* exceptions if needed.
*
* @param parameter The parameter
* @param context The command execution context, as well as arguments that have been resolved
* @return The parsed object. This should never be null.
*/
T resolve(@NotNull CommandParameter parameter, @NotNull ExecutionContext<A> context);
}ContextParameter.Factory Interface
Example: PlayerWorldContextParameterFactory
Registering ContextParameter.Factory
Last updated
Was this helpful?