Skip to main content

Commands Overview

Gate provides a powerful command system built on top of the Brigadier library, allowing you to register custom proxy commands that players can execute.

Command Architecture

Gate’s command system consists of several key components:

Command Manager

The command.Manager handles command registration and execution:
Source: pkg/command/command.go:14-15

Command Source

The Source interface represents the command invoker (player or console):
Source: pkg/command/command.go:19-23

Basic Concepts

Command Context

Every command receives a Context containing:
  • Command arguments
  • Source (who executed the command)
  • Parsed parameters

Command Execution

Commands are executed through a pipeline:
  1. Parse: Command input is parsed into a ParseResults
  2. Execute: Parsed command is executed with context
  3. Response: Results are sent back to the source
Source: pkg/command/command.go:102-104

Built-in Commands

Gate includes several built-in commands:
Built-in commands can be disabled via builtinCommands: false in config.yml.

Next Steps

Command Registration

Learn how to register custom commands

Using Brigadier

Master Brigadier’s node system

Permissions

Implement permission checks

Command Examples

See complete command implementations