Class CommandDefinition
Represents a single overload of a command (one specific method implementation). Multiple overloads can exist for the same command with different parameter types.
public class CommandDefinition
- Inheritance
-
CommandDefinition
- Inherited Members
Constructors
CommandDefinition(string, CommandGroup?, MethodInfo, ParameterInfo[], Type, CommandParameterInfo[], CommandInvoker, int, CommandAlias[], CommandTag[], CommandComponentMatcher)
Initializes a new instance.
public CommandDefinition(string name, CommandGroup? group, MethodInfo method, ParameterInfo[] parameters, Type declaringSystemType, CommandParameterInfo[] parsedParameters, CommandInvoker invoker, int prefixParameterCount, CommandAlias[] aliases, CommandTag[] tags, CommandComponentMatcher componentMatcher)
Parameters
namestringgroupCommandGroup?methodMethodInfoparametersParameterInfo[]declaringSystemTypeTypeparsedParametersCommandParameterInfo[]invokerCommandInvokerprefixParameterCountintaliasesCommandAlias[]tagsCommandTag[]componentMatcherCommandComponentMatcher
Properties
Aliases
Aliases for this overload.
public IReadOnlyList<CommandAlias> Aliases { get; }
Property Value
CompiledComponentMatcher
Gets the matcher used to evaluate command components.
public CommandComponentMatcher CompiledComponentMatcher { get; }
Property Value
CompiledInvoker
Gets the invoker used to execute the associated command efficiently.
public CommandInvoker CompiledInvoker { get; }
Property Value
DeclaringSystemType
The type of the ISystem that declares this command.
public Type DeclaringSystemType { get; }
Property Value
FullName
The full command path (group + name), e.g., "admin money give".
public string FullName { get; }
Property Value
Group
The command group, if any (e.g., ["admin", "money"]).
public CommandGroup? Group { get; }
Property Value
Method
The method that implements this command overload.
public MethodInfo Method { get; }
Property Value
MethodParameters
All parameters of the method (including prefix and DI).
public ParameterInfo[] MethodParameters { get; }
Property Value
Name
The command name (without leading slash or group prefix).
public string Name { get; }
Property Value
ParsedParameters
Parameters that are parsed from command input (excludes prefix and DI parameters). These are in the order they appear in the method signature.
public CommandParameterInfo[] ParsedParameters { get; }
Property Value
PrefixParameterCount
The number of prefix parameters (e.g., Player for player commands, ConsoleCommandSender for console commands).
public int PrefixParameterCount { get; }
Property Value
Tags
Custom metadata tags attached to this overload.
public IReadOnlyDictionary<string, string> Tags { get; }