Enum Class MinecraftArgumentType

java.lang.Object
java.lang.Enum<MinecraftArgumentType>
revxrsal.commands.bukkit.brigadier.MinecraftArgumentType
All Implemented Interfaces:
Serializable, Comparable<MinecraftArgumentType>, Constable

public enum MinecraftArgumentType extends Enum<MinecraftArgumentType>
An enumeration for containing Minecraft's built-in ArgumentTypes
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Represents 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 mirror
    Template rotation
    Represents 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 Type
    Method
    Description
    <T> @NotNull com.mojang.brigadier.arguments.ArgumentType<T>
    create(Object... arguments)
    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 an Optional
    boolean
    Checks if this argument type is supported in this Minecraft version
    boolean
    Checks if this argument type requires parameters
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • ENTITY

      public static final MinecraftArgumentType ENTITY
      A selector, player name, or UUID.

      Parameters: - boolean single - boolean playerOnly

    • GAME_PROFILE

      public static final MinecraftArgumentType GAME_PROFILE
      A player, online or not. Can also use a selector, which may match one or more players (but not entities).
    • COLOR

      public static final MinecraftArgumentType COLOR
      A chat color. One of the names from colors, or reset. Case-insensitive.
    • COMPONENT

      public static final MinecraftArgumentType COMPONENT
      A JSON Chat component.
    • MESSAGE

      public static final MinecraftArgumentType MESSAGE
      A regular message, potentially including selectors.
    • NBT

      public static final MinecraftArgumentType NBT
      An NBT value, parsed using JSON-NBT rules. This represents a full NBT tag.
    • NBT_TAG

      public static final MinecraftArgumentType NBT_TAG
      Represents a partial NBT tag, usable in data modify command.
    • NBT_PATH

      public static final MinecraftArgumentType NBT_PATH
      A path within an NBT value, allowing for array and member accesses.
    • SCOREBOARD_OBJECTIVE

      public static final MinecraftArgumentType SCOREBOARD_OBJECTIVE
      A scoreboard objective.
    • OBJECTIVE_CRITERIA

      public static final MinecraftArgumentType OBJECTIVE_CRITERIA
      A single score criterion.
    • SCOREBOARD_SLOT

      public static final MinecraftArgumentType SCOREBOARD_SLOT
      A scoreboard operator.
    • SCORE_HOLDER

      public static final MinecraftArgumentType SCORE_HOLDER
      Something that can join a team. Allows selectors and *.
    • TEAM

      public static final MinecraftArgumentType TEAM
      The name of a team. Parsed as an unquoted string.
    • OPERATION

      public static final MinecraftArgumentType OPERATION
      A scoreboard operator.
    • PARTICLE

      public static final MinecraftArgumentType PARTICLE
      A particle effect (an identifier with extra information following it for specific particles, mirroring the Particle packet)
    • ANGLE

      public static final MinecraftArgumentType ANGLE
      Represents an angle.
    • ITEM_SLOT

      public static final MinecraftArgumentType ITEM_SLOT
      A name for an inventory slot.
    • RESOURCE_LOCATION

      public static final MinecraftArgumentType RESOURCE_LOCATION
      An Identifier.
    • POTION_EFFECT

      public static final MinecraftArgumentType POTION_EFFECT
      A potion effect.
    • ENCHANTMENT

      public static final MinecraftArgumentType ENCHANTMENT
      Represents a item enchantment.
    • ENTITY_SUMMON

      public static final MinecraftArgumentType ENTITY_SUMMON
      Represents an entity summon.
    • DIMENSION

      public static final MinecraftArgumentType DIMENSION
      Represents a dimension.
    • TIME

      public static final MinecraftArgumentType TIME
      Represents a time duration.
    • UUID

      public static final MinecraftArgumentType UUID
      Represents a UUID value.
      Since:
      Minecraft 1.16
    • BLOCK_POS

      public static final MinecraftArgumentType BLOCK_POS
      A location, represented as 3 numbers (which must be integers). May use relative locations with ~
    • COLUMN_POS

      public static final MinecraftArgumentType COLUMN_POS
      A column location, represented as 3 numbers (which must be integers). May use relative locations with ~.
    • VECTOR_3

      public static final MinecraftArgumentType 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

      public static final MinecraftArgumentType 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

      public static final MinecraftArgumentType 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

      public static final MinecraftArgumentType SWIZZLE
      A collection of up to 3 axes.
    • BLOCK_STATE

      public static final MinecraftArgumentType BLOCK_STATE
      A block state, optionally including NBT and state information.
    • BLOCK_PREDICATE

      public static final MinecraftArgumentType BLOCK_PREDICATE
      A block, or a block tag.
    • ITEM_STACK

      public static final MinecraftArgumentType ITEM_STACK
      An item, optionally including NBT.
    • ITEM_PREDICATE

      public static final MinecraftArgumentType ITEM_PREDICATE
      An item, or an item tag.
    • FUNCTION

      public static final MinecraftArgumentType FUNCTION
      A function.
    • ENTITY_ANCHOR

      public static final MinecraftArgumentType ENTITY_ANCHOR
      The entity anchor related to the facing argument in the teleport command, is feet or eyes.
    • INT_RANGE

      public static final MinecraftArgumentType INT_RANGE
      An integer range of values with a min and a max.
    • FLOAT_RANGE

      public static final MinecraftArgumentType FLOAT_RANGE
      A floating-point range of values with a min and a max.
    • TEMPLATE_MIRROR

      public static final MinecraftArgumentType TEMPLATE_MIRROR
      Template mirror
      Since:
      Minecraft 1.19
    • TEMPLATE_ROTATION

      public static final MinecraftArgumentType TEMPLATE_ROTATION
      Template rotation
      Since:
      Minecraft 1.19
  • Method Details

    • values

      public static MinecraftArgumentType[] 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

      public static MinecraftArgumentType valueOf(String name)
      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 name
      NullPointerException - 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 version
      IllegalArgumentException - if this argument requires arguments. See create(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 an Optional
      Type Parameters:
      T - The argument type
      Returns:
      The argument type optional
      Throws:
      IllegalArgumentException - if this argument requires arguments. See createIfPresent(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()