Class ClientCommandInternals

java.lang.Object
net.fabricmc.fabric.impl.command.client.ClientCommandInternals

public final class ClientCommandInternals extends Object
  • Constructor Details

    • ClientCommandInternals

      public ClientCommandInternals()
  • Method Details

    • setActiveDispatcher

      public static void setActiveDispatcher(@Nullable com.mojang.brigadier.CommandDispatcher<FabricClientCommandSource> dispatcher)
    • getActiveDispatcher

      public static @Nullable com.mojang.brigadier.CommandDispatcher<FabricClientCommandSource> getActiveDispatcher()
    • executeCommand

      public static boolean executeCommand(String command)
      Executes a client-sided command. Callers should ensure that this is only called on slash-prefixed messages and the slash needs to be removed before calling.
      Parameters:
      command - the command with slash removed
      Returns:
      true if the command should not be sent to the server, false otherwise
    • finalizeInit

      public static void finalizeInit()
      Runs final initialization tasks such as CommandDispatcher.findAmbiguities(AmbiguityConsumer) on the command dispatcher. Also registers a /fcc help command if there are other commands present.
    • addCommands

      public static void addCommands(com.mojang.brigadier.CommandDispatcher<FabricClientCommandSource> target, FabricClientCommandSource source)