Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/qualk/take-care/llms.txt

Use this file to discover all available pages before exploring further.

Meteor commands are triggered by the player typing a prefix character (. by default) followed by the command name in the chat box. Under the hood they use the Brigadier command dispatcher, the same library Minecraft itself uses for server commands. Each command extends meteordevelopment.meteorclient.commands.Command, builds a tree of literals and arguments by overriding build(), and is registered with Commands.add() in TakeCare.onInitialize().

Creating a command

1

Create a class extending Command

Add a new Java class inside the commands/ package (kpn.qualk.takecare.commands). The class must extend meteordevelopment.meteorclient.commands.Command:
commands/YourCommand.java
package kpn.qualk.takecare.commands;

import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.client.multiplayer.ClientSuggestionProvider;

public class YourCommand extends Command {
    public YourCommand() {
        super("your-command", "A short description.");
    }

    @Override
    public void build(LiteralArgumentBuilder<ClientSuggestionProvider> builder) {
        // define the command tree here
    }
}
2

Call super() with the name and description

The Command constructor takes two arguments:
ArgumentValue
nameA kebab-case string used after the prefix, e.g. "example".example
descriptionA plain-text sentence shown in .help output
The name parameter must be in kebab-case. The prefix character (default .) is configured by the user in Meteor Client settings and cannot be overridden by the addon.
3

Override build() and define the Brigadier command tree

The build() method receives a LiteralArgumentBuilder pre-seeded with the command name. Use .executes() to attach an action to the current node, and .then() to add sub-literals or arguments.The base class exposes helper methods:
  • info(String message) — sends a styled info message to the player’s chat.
  • error(String message) — sends an error-styled message.
  • literal(String name) — shorthand for Commands.literal(name).
  • argument(String name, ArgumentType<?> type) — shorthand for Commands.argument(name, type).
  • SINGLE_SUCCESS — the Brigadier constant for a successful execution (1).
A command with both a bare execution and a sub-literal with a string argument looks like this:
commands/CommandExample.java
@Override
public void build(LiteralArgumentBuilder<ClientSuggestionProvider> builder) {
    builder.executes(_ -> {
        info("hi");
        return SINGLE_SUCCESS;
    });

    builder.then(literal("name").then(
        argument("nameArgument", StringArgumentType.word()).executes(context -> {
            String argument = StringArgumentType.getString(context, "nameArgument");
            info("hi, " + argument);
            return SINGLE_SUCCESS;
        })
    ));
}
This produces two usable invocations:
  • .example → sends hi
  • .example name <word> → sends hi, <word>
4

Register the command in TakeCare.onInitialize()

Open TakeCare.java and call Commands.add(new YourCommand()) inside onInitialize():
TakeCare.java
import meteordevelopment.meteorclient.systems.commands.Commands;

@Override
public void onInitialize() {
    LOG.info("Initialising Meteor addon: " + getPackage());

    Modules.get().add(new AssetProtection());
    Modules.get().add(new ParrotDeadener());

    Commands.add(new YourCommand());
}

Full working example

Below is the complete CommandExample class from the Take Care source (shown uncommented and ready to use):
commands/CommandExample.java
package kpn.qualk.takecare.commands;

import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.client.multiplayer.ClientSuggestionProvider;

public class CommandExample extends Command {
    public CommandExample() {
        super("example", "Sends a message.");
    }

    @Override
    public void build(LiteralArgumentBuilder<ClientSuggestionProvider> builder) {
        builder.executes(_ -> {
            info("hi");
            return SINGLE_SUCCESS;
        });

        builder.then(literal("name").then(
            argument("nameArgument", StringArgumentType.word()).executes(context -> {
                String argument = StringArgumentType.getString(context, "nameArgument");
                info("hi, " + argument);
                return SINGLE_SUCCESS;
            })
        ));
    }
}

Build docs developers (and LLMs) love