Class RegisterClientCommandsEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RegisterClientCommandsEvent

public class RegisterClientCommandsEvent extends net.neoforged.bus.api.Event
Fired to allow mods to register client commands.

Some command arguments behave differently for the client commands dispatcher:

This event is not

invalid reference
cancellable
, and does not
invalid reference
have a result
.

This event is fired on the main Forge event bus, only on the logical client.

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getDispatcher

      public com.mojang.brigadier.CommandDispatcher<CommandSourceStack> getDispatcher()
      Returns 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
    • getBuildContext

      public CommandBuildContext getBuildContext()
      Returns the context to build the commands for.
      Returns:
      the context to build the commands for