StringArgument

class StringArgument<T>(name: String, type: StringArgument.Type, suggestion: SuggestionAction<T>?, action: ContextAction<T>?) : Argument<String, T>

String argument type. You can specify string type. If it is not the specified type, an error will be displayed on the client side and the attempt to execute will not be accepted. String Type: WORD ->helloworld String Type: PHRASE_QUOTED ->helloworld"This is quoted string" String Type: PHRASE ->hello stringword"Quoted string"

See also

Parameters

name

Name of argument.

type

Text type.

suggestion

Lambda expression for tab completion of its arguments.

Check the following for the specifications of other arguments.

Constructors

StringArgument
Link copied to clipboard
fun <T> StringArgument(name: String, type: StringArgument.Type = Type.WORD, suggestion: SuggestionAction<T>? = null, action: ContextAction<T>? = null)

Types

Type
Link copied to clipboard
enum Type : Enum<StringArgument.Type>

The type of argument input.

Functions

parse
Link copied to clipboard
open override fun parse(context: CommandContext<CommandListenerWrapper>, key: String): String

Properties

action
Link copied to clipboard
open override val action: ContextAction<T>? = null

Argument context action

name
Link copied to clipboard
open override val name: String
suggestion
Link copied to clipboard
open override val suggestion: SuggestionAction<T>? = null
type
Link copied to clipboard
open override val type: StringArgumentType

Mojang Brigadier argument type.