API reference / @jsprismarine/brigadier / CommandContextBuilder
Class: CommandContextBuilder<S>
Defined in: context/CommandContextBuilder.ts:11
Type Parameters
S
S
Constructors
Constructor
new CommandContextBuilder<
S>(dispatcher,source,rootNode,start):CommandContextBuilder<S>
Defined in: context/CommandContextBuilder.ts:32
Parameters
dispatcher
source
S
rootNode
CommandNode<S> | null
start
number
Returns
CommandContextBuilder<S>
Methods
build()
build(
input):CommandContext<S>
Defined in: context/CommandContextBuilder.ts:129
Parameters
input
string
Returns
copy()
copy():
CommandContextBuilder<S>
Defined in: context/CommandContextBuilder.ts:74
Returns
CommandContextBuilder<S>
copyFor()
copyFor(
source):CommandContextBuilder<S>
Defined in: context/CommandContextBuilder.ts:97
Copies this parse context tree for a new source while keeping the parsed arguments and nodes.
Parameters
source
S
The source that execution and redirect modifiers should observe.
Returns
CommandContextBuilder<S>
findSuggestionContext()
findSuggestionContext(
cursor):SuggestionsContext<S>
Defined in: context/CommandContextBuilder.ts:152
Parameters
cursor
number
Returns
getArguments()
getArguments():
Map<String,ParsedArgument<S,any>>
Defined in: context/CommandContextBuilder.ts:57
Returns
Map<String, ParsedArgument<S, any>>
getChild()
getChild():
CommandContextBuilder<S> |null
Defined in: context/CommandContextBuilder.ts:108
Returns
CommandContextBuilder<S> | null
getCommand()
getCommand():
Command<S>
Defined in: context/CommandContextBuilder.ts:121
Returns
Command<S>
getDispatcher()
getDispatcher():
CommandDispatcher<S>
Defined in: context/CommandContextBuilder.ts:144
Returns
getLastChild()
getLastChild():
CommandContextBuilder<S> |null
Defined in: context/CommandContextBuilder.ts:112
Returns
CommandContextBuilder<S> | null
getNodes()
getNodes():
ParsedCommandNode<S>[]
Defined in: context/CommandContextBuilder.ts:125
Returns
ParsedCommandNode<S>[]
getRange()
getRange():
StringRange
Defined in: context/CommandContextBuilder.ts:148
Returns
getRootNode()
getRootNode():
CommandNode<S> |null
Defined in: context/CommandContextBuilder.ts:48
Returns
CommandNode<S> | null
getSource()
getSource():
S
Defined in: context/CommandContextBuilder.ts:44
Returns
S
withArgument()
withArgument(
name,argument):CommandContextBuilder<S>
Defined in: context/CommandContextBuilder.ts:52
Parameters
name
String
argument
ParsedArgument<S, any>
Returns
CommandContextBuilder<S>
withChild()
withChild(
child):CommandContextBuilder<S>
Defined in: context/CommandContextBuilder.ts:103
Parameters
child
CommandContextBuilder<S>
Returns
CommandContextBuilder<S>
withCommand()
withCommand(
command):CommandContextBuilder<S>
Defined in: context/CommandContextBuilder.ts:61
Parameters
command
Command<S>
Returns
CommandContextBuilder<S>
withNode()
withNode(
node,range):CommandContextBuilder<S>
Defined in: context/CommandContextBuilder.ts:66
Parameters
node
CommandNode<S>
range
Returns
CommandContextBuilder<S>
withSource()
withSource(
source):CommandContextBuilder<S>
Defined in: context/CommandContextBuilder.ts:39
Parameters
source
S
Returns
CommandContextBuilder<S>