Skip to content

API reference / @jsprismarine/brigadier / CommandContext

Class: CommandContext<S> ​

Defined in: context/CommandContext.ts:9

Type Parameters ​

S ​

S

Constructors ​

Constructor ​

new CommandContext<S>(source, input, args, command, rootNode, nodes, range, child, modifier, forks): CommandContext<S>

Defined in: context/CommandContext.ts:21

Parameters ​

source ​

S

input ​

string

args ​

Map<String, ParsedArgument<S, any>>

command ​

Command<S> | null

rootNode ​

CommandNode<S> | null

nodes ​

ParsedCommandNode<S>[] | null

range ​

StringRange

child ​

CommandContext<S> | null

modifier ​

RedirectModifier<S> | null

forks ​

boolean

Returns ​

CommandContext<S>

Methods ​

copyFor() ​

copyFor(source): CommandContext<S>

Defined in: context/CommandContext.ts:45

Parameters ​

source ​

S

Returns ​

CommandContext<S>


equals() ​

equals(o?): boolean

Defined in: context/CommandContext.ts:97

Parameters ​

o? ​

object | null = null

Returns ​

boolean


getArgument() ​

getArgument(name, clazz?): any

Defined in: context/CommandContext.ts:82

Parameters ​

name ​

string

clazz? ​

Function

Returns ​

any


getChild() ​

getChild(): CommandContext<S> | null

Defined in: context/CommandContext.ts:62

Returns ​

CommandContext<S> | null


getCommand() ​

getCommand(): Command<S> | null

Defined in: context/CommandContext.ts:74

Returns ​

Command<S> | null


getInput() ​

getInput(): string

Defined in: context/CommandContext.ts:119

Returns ​

string


getLastChild() ​

getLastChild(): CommandContext<S>

Defined in: context/CommandContext.ts:66

Returns ​

CommandContext<S>


getNodes() ​

getNodes(): ParsedCommandNode<S>[]

Defined in: context/CommandContext.ts:127

Returns ​

ParsedCommandNode<S>[]


getRange() ​

getRange(): StringRange

Defined in: context/CommandContext.ts:115

Returns ​

StringRange


getRedirectModifier() ​

getRedirectModifier(): RedirectModifier<S> | null

Defined in: context/CommandContext.ts:111

Returns ​

RedirectModifier<S> | null


getRootNode() ​

getRootNode(): CommandNode<S>

Defined in: context/CommandContext.ts:123

Returns ​

CommandNode<S>


getSource() ​

getSource(): S

Defined in: context/CommandContext.ts:78

Returns ​

S


hasNodes() ​

hasNodes(): boolean

Defined in: context/CommandContext.ts:131

Returns ​

boolean


isForked() ​

isForked(): boolean

Defined in: context/CommandContext.ts:135

Returns ​

boolean