EntityArgument

class EntityArgument<T>(name: String, enableSelector: Boolean, enableEntities: Boolean, suggestion: SuggestionAction<T>?, action: ContextAction<T>?) : Argument<List<Entity>, T>

An argument that takes a player name or entity selector as input. If a player name that does not exist or an invalid selector is entered, an error will be displayed on the client side, and even if you try to execute it, it will not be accepted. Expected input: PlayerName@a, @r, @e[distance=..5]

See also

Parameters

name

Name of argument.

enableSelector

Enables the use of selectors.

enableEntities

Allows you to select an entity.

suggestion

Lambda expression for tab completion of its arguments.

Check the following for the specifications of other arguments.

Constructors

EntityArgument
Link copied to clipboard
fun <T> EntityArgument(name: String, enableSelector: Boolean = true, enableEntities: Boolean = true, suggestion: SuggestionAction<T>?, action: ContextAction<T>? = null)

Functions

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

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>?
type
Link copied to clipboard
open override val type: ArgumentEntity

Mojang Brigadier argument type.