CommandParser

Parses Minecraft command strings, handling quoted arguments, coordinates, and entity selectors.

All methods are pure string operations with no Minecraft dependencies.

Types

Link copied to clipboard
data class ParsedCommand(val baseCommand: String, val arguments: List<String>)

A parsed command with its base name and argument list.

Functions

Link copied to clipboard

Extracts all coordinate-like tokens from a command string.

Link copied to clipboard

Extracts all entity selector tokens from a command string.

Link copied to clipboard

Returns true if the argument matches a Minecraft coordinate pattern.

Link copied to clipboard

Returns true if the command would be considered destructive (mass kill, fill with air).

Link copied to clipboard

Returns true if the argument is a local coordinate (^).

Link copied to clipboard

Returns true if the argument is a relative coordinate (~).

Link copied to clipboard

Returns true if the argument matches a Minecraft entity selector.

Link copied to clipboard

Returns a normalized form of the command (stripped of leading /, collapsed spaces).

Link copied to clipboard

Splits an input string into tokens, respecting double and single quotes.

Link copied to clipboard

Parses a command string into its base command and arguments.