KContext

class KContext<S>(val rawContext: CommandContext<S>)

Typed accessor for retrieving parsed argument values from a Brigadier CommandContext.

Passed to executes and executesResult blocks. Use the accessor methods (e.g. string, integer) to retrieve arguments by the name used when defining them.

Constructors

Link copied to clipboard
constructor(rawContext: CommandContext<S>)

Properties

Link copied to clipboard
val rawContext: CommandContext<S>
Link copied to clipboard
val source: S

The raw command source provided by the platform.

Functions

Link copied to clipboard
fun boolean(name: String): Boolean

Returns the parsed Boolean for the argument registered as name.

Link copied to clipboard
fun double(name: String): Double

Returns the parsed Double for the argument registered as name.

Link copied to clipboard
fun float(name: String): Float

Returns the parsed Float for the argument registered as name.

Link copied to clipboard

Returns the string value. Alias for string. @see LiteralNode.greedyString

Link copied to clipboard
fun integer(name: String): Int

Returns the parsed Int for the argument registered as name.

Link copied to clipboard
fun long(name: String): Long

Returns the parsed Long for the argument registered as name.

Link copied to clipboard
fun string(name: String): String

Returns the parsed String for the argument registered as name.

Link copied to clipboard
fun <S> KContext<S>.word(name: String): String

Returns the string value. Alias for string. @see LiteralNode.word