SuspendingCommandElement

abstract class SuspendingCommandElement(pluginContainer: <ERROR CLASS>, text: <ERROR CLASS>)

Functions

complete
Link copied to clipboard
abstract suspend fun complete(src: <ERROR CLASS>, args: <ERROR CLASS>, context: <ERROR CLASS>): List<String?>?

Fetch completions for command arguments.

getKey
Link copied to clipboard
open fun getKey(): <ERROR CLASS>?

Return the key to be used for this object.

getUntranslatedKey
Link copied to clipboard
open fun getUntranslatedKey(): String?

Return the plain key, to be used when looking up this command element in a CommandContext. If the key is a TranslatableText, this is the translation's id. Otherwise, this is the result of Text.toPlain.

getUsage
Link copied to clipboard
open fun getUsage(src: <ERROR CLASS>): <ERROR CLASS>?

Return a usage message for this specific argument.

parse
Link copied to clipboard
open fun parse(source: <ERROR CLASS>, args: <ERROR CLASS>, context: <ERROR CLASS>)

Attempt to extract a value for this element from the given arguments and put it in the given context. This method normally delegates to .parseValue for getting the values. This method is expected to have no side-effects for the source, meaning that executing it will not change the state of the CommandSource in any way.

toCommandElement
Link copied to clipboard
fun toCommandElement(): <ERROR CLASS>

Converts this SuspendingCommandElement to a Sponge-Api compatible CommandElement.