CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
com.mojang.brigadier.RedirectModifier< S > Interface Template Reference

A redirect modifier to apply when a command is redirected and/or forked. More...

Public Member Functions

Collection< S > apply (CommandContext< S > context) throws CommandSyntaxException
 Applies the modifier to the context, so it creates a list of command sources to invoke the target command for. More...
 

Detailed Description

A redirect modifier to apply when a command is redirected and/or forked.

A redirect modifier takes a command context with a single command source and returns a collection of multiple command sources. The target command is then invoked for each of the returned command sources.

Parameters
<S>the type of the command source

Member Function Documentation

◆ apply()

Collection< S > com.mojang.brigadier.RedirectModifier< S >.apply ( CommandContext< S >  context) throws CommandSyntaxException

Applies the modifier to the context, so it creates a list of command sources to invoke the target command for.

Parameters
contextthe context to base it on
Returns
a collection with command sources to invoke the command for
Exceptions
CommandSyntaxExceptionif an error occurred