Skip to content

Class Arguments

Namespace: Void.Minecraft.Commands.Brigadier
Assembly: Void.Minecraft.dll

Provides concise factories and context accessors for built-in Brigadier argument types.

public class Arguments

Inheritance

objectArguments

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

Bool()

Creates a Boolean argument type.

public static BoolArgumentType Bool()

Returns

BoolArgumentType

The Boolean argument type.

Double(double, double)

Creates a double argument with inclusive bounds.

public static DoubleArgumentType Double(double min = -1.7976931348623157E+308, double max = 1.7976931348623157E+308)

Parameters

min double

The inclusive minimum.

max double

The inclusive maximum.

Returns

DoubleArgumentType

The double argument type.

Float(float, float)

Creates a float argument with inclusive bounds.

public static FloatArgumentType Float(float min = -3.4028235E+38, float max = 3.4028235E+38)

Parameters

min float

The inclusive minimum.

max float

The inclusive maximum.

Returns

FloatArgumentType

The float argument type.

GetBool(CommandContext, string)

Gets a parsed Boolean argument.

public static bool GetBool(CommandContext context, string name)

Parameters

context CommandContext

The command context.

name string

The argument name.

Returns

bool

The parsed value.

GetDouble(CommandContext, string)

Gets a parsed double argument.

public static double GetDouble(CommandContext context, string name)

Parameters

context CommandContext

The command context.

name string

The argument name.

Returns

double

The parsed value.

GetFloat(CommandContext, string)

Gets a parsed float argument.

public static float GetFloat(CommandContext context, string name)

Parameters

context CommandContext

The command context.

name string

The argument name.

Returns

float

The parsed value.

GetInteger(CommandContext, string)

Gets the parsed integer argument with the specified name from a command context.

public static int GetInteger(CommandContext context, string name)

Parameters

context CommandContext

The command context that contains parsed arguments.

name string

The name of the parsed argument to retrieve.

Returns

int

The parsed value associated with name.

Exceptions

ArgumentException

No argument named name exists in context, or the argument was parsed as a type other than .

ArgumentNullException

name is null.

GetLong(CommandContext, string)

Gets a parsed long argument.

public static long GetLong(CommandContext context, string name)

Parameters

context CommandContext

The command context.

name string

The argument name.

Returns

long

The parsed value.

GetString(CommandContext, string)

Gets a parsed string argument.

public static string GetString(CommandContext context, string name)

Parameters

context CommandContext

The command context.

name string

The argument name.

Returns

string

The parsed value.

GreedyString()

Creates a string argument that consumes the remaining input.

public static StringArgumentType GreedyString()

Returns

StringArgumentType

The string argument type.

Integer(int, int)

Creates an integer argument with inclusive bounds.

public static IntegerArgumentType Integer(int min = -2147483648, int max = 2147483647)

Parameters

min int

The inclusive minimum.

max int

The inclusive maximum.

Returns

IntegerArgumentType

The integer argument type.

Long(long, long)

Creates a long argument with inclusive bounds.

public static LongArgumentType Long(long min = -9223372036854775808, long max = 9223372036854775807)

Parameters

min long

The inclusive minimum.

max long

The inclusive maximum.

Returns

LongArgumentType

The long argument type.

String()

Creates a quotable string argument.

public static StringArgumentType String()

Returns

StringArgumentType

The string argument type.

Word()

Creates a single-word string argument.

public static StringArgumentType Word()

Returns

StringArgumentType

The string argument type.