FloatArgument

class FloatArgument<T>(name: String, min: Float, max: Float, suggestion: SuggestionAction<T>?, action: ContextAction<T>?) : Argument<Float, T>

Anti-precision floating point argument. You can set the minimum and maximum values. If it falls below the minimum value or exceeds the maximum value, an error will be displayed on the client side, and even if you try to execute it, it will not be accepted. Expected input: 26.3-1200.0

See also

Parameters

name

Name of argument.

min

The lowest possible value for this argument.

max

The highest possible value for this argument.

suggestion

Lambda expression for tab completion of its arguments.

Check the following for the specifications of other arguments.

Constructors

FloatArgument
Link copied to clipboard
fun <T> FloatArgument(name: String, min: Float = Float.MIN_VALUE, max: Float = Float.MAX_VALUE, suggestion: SuggestionAction<T>? = null, action: ContextAction<T>? = null)

Functions

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

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: ArgumentType<*>?

Mojang Brigadier argument type.