- Type Parameters:
C- The type of command that is being registered.
public interface RegisterCommandEvent<C> extends GenericEvent<C>, LifecycleEventLifecycle event to indicate when commands should be registered.
This event is generic and the type parameter is required. This type parameter (
C) will correspond to the base class or interface that your command inherits from.
There are two types of command that Sponge will always call an event for:
Commands that have been generated using
Command.builder()should be registered during the
Other plugins and platforms may provide a
CommandRegistrarthat allows for other types to be registered as commands. These types will be provided by these other plugins, consult their documentation for more details.
This event will be called whenever the game re-initializes commands, and does not guarantee that any specific engine is running.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
register(org.spongepowered.plugin.PluginContainer container, C command, String alias, String... aliases)Registers a command with the appropriate
RegisterCommandEvent.Result<C> register(org.spongepowered.plugin.PluginContainer container, C command, String alias, String... aliases) throws CommandFailedRegistrationExceptionRegisters a command with the appropriate
command- The command to register
alias- The first alias to register for this command
aliases- Any other aliases to register
RegisterCommandEvent.Result, which contains the
CommandMappingfor this registration, while also allowing for chaining of other command registrations.
CommandFailedRegistrationException- if registration failed