Package net.minecraftforge.client.event
Class RegisterClientCommandsEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RegisterClientCommandsEvent
public class RegisterClientCommandsEvent
extends net.minecraftforge.eventbus.api.Event
Fired to allow mods to register client commands.
 
Some command arguments behave differently for the client commands dispatcher:
- ResourceLocationArgument.getAdvancement(com.mojang.brigadier.context.CommandContext, String)only returns advancements that are shown on the advancements screen.
- ObjectiveArgument.getObjective(com.mojang.brigadier.context.CommandContext, String)only returns objectives that are displayed to the player.
This event is not cancellable, and does not have a result.
This event is fired on the main Forge event bus, only on the logical client.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final CommandBuildContextprivate final com.mojang.brigadier.CommandDispatcher<CommandSourceStack>
- 
Constructor SummaryConstructorsConstructorDescriptionRegisterClientCommandsEvent(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) 
- 
Method SummaryModifier and TypeMethodDescriptionReturns the context to build the commands for.com.mojang.brigadier.CommandDispatcher<CommandSourceStack>Returns the command dispatcher for registering commands to be executed on the client.Methods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
dispatcher
- 
context
 
- 
- 
Constructor Details- 
RegisterClientCommandsEvent@Internal public RegisterClientCommandsEvent(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) 
 
- 
- 
Method Details- 
getDispatcherReturns the command dispatcher for registering commands to be executed on the client.- Returns:
- the command dispatcher for registering commands to be executed on the client
 
- 
getBuildContextReturns the context to build the commands for.- Returns:
- the context to build the commands for
 
 
-