Enum Class MinecraftArgumentType
- All Implemented Interfaces:
Serializable
,Comparable<MinecraftArgumentType>
,Constable
An enumeration for containing Minecraft's built-in
ArgumentType
s-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionRepresents an angle.A location, represented as 3 numbers (which must be integers).A block, or a block tag.A block state, optionally including NBT and state information.A chat color.A column location, represented as 3 numbers (which must be integers).A JSON Chat component.Represents a dimension.Represents a item enchantment.A selector, player name, or UUID.The entity anchor related to the facing argument in the teleport command, is feet or eyes.Represents an entity summon.A floating-point range of values with a min and a max.A function.A player, online or not.An integer range of values with a min and a max.An item, or an item tag.A name for an inventory slot.An item, optionally including NBT.A regular message, potentially including selectors.An NBT value, parsed using JSON-NBT rules.A path within an NBT value, allowing for array and member accesses.Represents a partial NBT tag, usable in data modify command.A single score criterion.A scoreboard operator.A particle effect (an identifier with extra information following it for specific particles, mirroring the Particle packet)A potion effect.An Identifier.An angle, represented as 2 numbers (which may have a decimal point, but will be moved to the center of a block if none is specified).Something that can join a team.A scoreboard objective.A scoreboard operator.A collection of up to 3 axes.The name of a team.Template mirrorTemplate rotationRepresents a time duration.Represents a UUID value.A location, represented as 2 numbers (which may have a decimal point, but will be moved to the center of a block if none is specified).A location, represented as 3 numbers (which may have a decimal point, but will be moved to the center of a block if none is specified). -
Method Summary
Modifier and TypeMethodDescription<T> @NotNull com.mojang.brigadier.arguments.ArgumentType<T>
Creates an instance of this argument type<T> @NotNull Optional<com.mojang.brigadier.arguments.ArgumentType<T>>
createIfPresent
(Object... arguments) Creates an instance of this argument type, wrapped in an optional.static void
<T> @NotNull com.mojang.brigadier.arguments.ArgumentType<T>
get()
Returns the argument type represented by this enum value, otherwise throws an exception<T> @NotNull Optional<com.mojang.brigadier.arguments.ArgumentType<T>>
Returns the argument type represented by this enum value, wrapped inside anOptional
boolean
Checks if this argument type is supported in this Minecraft versionboolean
Checks if this argument type requires parametersstatic MinecraftArgumentType
Returns the enum constant of this class with the specified name.static MinecraftArgumentType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ENTITY
A selector, player name, or UUID.Parameters: - boolean single - boolean playerOnly
-
GAME_PROFILE
A player, online or not. Can also use a selector, which may match one or more players (but not entities). -
COLOR
A chat color. One of the names from colors, orreset
. Case-insensitive. -
COMPONENT
A JSON Chat component. -
MESSAGE
A regular message, potentially including selectors. -
NBT
An NBT value, parsed using JSON-NBT rules. This represents a full NBT tag. -
NBT_TAG
Represents a partial NBT tag, usable in data modify command. -
NBT_PATH
A path within an NBT value, allowing for array and member accesses. -
SCOREBOARD_OBJECTIVE
A scoreboard objective. -
OBJECTIVE_CRITERIA
A single score criterion. -
SCOREBOARD_SLOT
A scoreboard operator. -
SCORE_HOLDER
Something that can join a team. Allows selectors and *. -
TEAM
The name of a team. Parsed as an unquoted string. -
OPERATION
A scoreboard operator. -
PARTICLE
A particle effect (an identifier with extra information following it for specific particles, mirroring the Particle packet) -
ANGLE
Represents an angle. -
ITEM_SLOT
A name for an inventory slot. -
RESOURCE_LOCATION
An Identifier. -
POTION_EFFECT
A potion effect. -
ENCHANTMENT
Represents a item enchantment. -
ENTITY_SUMMON
Represents an entity summon. -
DIMENSION
Represents a dimension. -
TIME
Represents a time duration. -
UUID
Represents a UUID value.- Since:
- Minecraft 1.16
-
BLOCK_POS
A location, represented as 3 numbers (which must be integers). May use relative locations with ~ -
COLUMN_POS
A column location, represented as 3 numbers (which must be integers). May use relative locations with ~. -
VECTOR_3
A location, represented as 3 numbers (which may have a decimal point, but will be moved to the center of a block if none is specified). May use relative locations with ~. -
VECTOR_2
A location, represented as 2 numbers (which may have a decimal point, but will be moved to the center of a block if none is specified). May use relative locations with ~. -
ROTATION
An angle, represented as 2 numbers (which may have a decimal point, but will be moved to the center of a block if none is specified). May use relative locations with ~. -
SWIZZLE
A collection of up to 3 axes. -
BLOCK_STATE
A block state, optionally including NBT and state information. -
BLOCK_PREDICATE
A block, or a block tag. -
ITEM_STACK
An item, optionally including NBT. -
ITEM_PREDICATE
An item, or an item tag. -
FUNCTION
A function. -
ENTITY_ANCHOR
The entity anchor related to the facing argument in the teleport command, is feet or eyes. -
INT_RANGE
An integer range of values with a min and a max. -
FLOAT_RANGE
A floating-point range of values with a min and a max. -
TEMPLATE_MIRROR
Template mirror- Since:
- Minecraft 1.19
-
TEMPLATE_ROTATION
Template rotation- Since:
- Minecraft 1.19
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isSupported
public boolean isSupported()Checks if this argument type is supported in this Minecraft version- Returns:
- If this is supported
-
requiresParameters
public boolean requiresParameters()Checks if this argument type requires parameters- Returns:
- If this requires parameters
-
get
@NotNull public <T> @NotNull com.mojang.brigadier.arguments.ArgumentType<T> get()Returns the argument type represented by this enum value, otherwise throws an exception- Type Parameters:
T
- The argument type- Returns:
- The argument type
- Throws:
IllegalArgumentException
- if not supported in this versionIllegalArgumentException
- if this argument requires arguments. Seecreate(Object...)
-
create
@NotNull public <T> @NotNull com.mojang.brigadier.arguments.ArgumentType<T> create(Object... arguments) Creates an instance of this argument type- Type Parameters:
T
- The argument ttype- Parameters:
arguments
- Arguments to construct the argument type with- Returns:
- The created argument type.
- Throws:
IllegalArgumentException
- if not supported in this version
-
getIfPresent
@NotNull public <T> @NotNull Optional<com.mojang.brigadier.arguments.ArgumentType<T>> getIfPresent()Returns the argument type represented by this enum value, wrapped inside anOptional
- Type Parameters:
T
- The argument type- Returns:
- The argument type optional
- Throws:
IllegalArgumentException
- if this argument requires arguments. SeecreateIfPresent(Object...)
-
createIfPresent
@NotNull public <T> @NotNull Optional<com.mojang.brigadier.arguments.ArgumentType<T>> createIfPresent(Object... arguments) Creates an instance of this argument type, wrapped in an optional.- Type Parameters:
T
- The argument ttype- Parameters:
arguments
- Arguments to construct the argument type with- Returns:
- The created argument type optional.
-
ensureSetup
public static void ensureSetup()
-