Class ArgumentTypes

java.lang.Object
io.papermc.paper.command.brigadier.argument.ArgumentTypes

@Experimental public final class ArgumentTypes extends Object
Vanilla Minecraft includes several custom ArgumentTypes that are recognized by the client. Many of these argument types include client-side completions and validation, and some include command signing context.

This class allows creating instances of these types for use in plugin commands, with friendly API result types.

CustomArgumentType is provided for customizing parsing or result types server-side, while sending the vanilla argument type to the client.

  • Method Details

    • entity

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<EntitySelectorArgumentResolver> entity()
      Represents a selector that can capture any single entity.
      Returns:
      argument that takes one entity
    • entities

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<EntitySelectorArgumentResolver> entities()
      Represents a selector that can capture multiple entities.
      Returns:
      argument that takes multiple entities
    • player

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<PlayerSelectorArgumentResolver> player()
      Represents a selector that can capture a singular player entity.
      Returns:
      argument that takes one player
    • players

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<PlayerSelectorArgumentResolver> players()
      Represents a selector that can capture multiple player entities.
      Returns:
      argument that takes multiple players
    • playerProfiles

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<PlayerProfileListResolver> playerProfiles()
      A selector argument that provides a list of player profiles.
      Returns:
      player profile arguments
    • blockPosition

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<BlockPositionResolver> blockPosition()
      A block position argument.
      Returns:
      argument
    • blockState

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<BlockState> blockState()
      A blockstate argument which will provide rich parsing for specifying the specific block variant and then the block entity NBT if applicable.
      Returns:
      argument
    • itemStack

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<ItemStack> itemStack()
      An ItemStack argument which provides rich parsing for specifying item material and item NBT information.
      Returns:
      argument
    • itemPredicate

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<ItemStackPredicate> itemPredicate()
      An item predicate argument.
      Returns:
      argument
    • namedColor

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<NamedTextColor> namedColor()
      An argument for parsing NamedTextColors.
      Returns:
      argument
    • component

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<Component> component()
      A component argument.
      Returns:
      argument
    • style

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<Style> style()
      A style argument.
      Returns:
      argument
    • signedMessage

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<SignedMessageResolver> signedMessage()
      A signed message argument. This argument can be resolved to retrieve the underlying signed message.
      Returns:
      argument
    • scoreboardDisplaySlot

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<DisplaySlot> scoreboardDisplaySlot()
      A scoreboard display slot argument.
      Returns:
      argument
    • namespacedKey

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<NamespacedKey> namespacedKey()
      A namespaced key argument.
      Returns:
      argument
    • key

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<net.kyori.adventure.key.Key> key()
      A key argument.
      Returns:
      argument
    • integerRange

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<IntegerRangeProvider> integerRange()
      An inclusive range of integers that may be unbounded on either end.
      Returns:
      argument
    • doubleRange

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<DoubleRangeProvider> doubleRange()
      An inclusive range of doubles that may be unbounded on either end.
      Returns:
      argument
    • world

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<World> world()
      A world argument.
      Returns:
      argument
    • gameMode

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<GameMode> gameMode()
      A game mode argument.
      Returns:
      argument
    • heightMap

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<HeightMap> heightMap()
      A argument for getting a heightmap type.
      Returns:
      argument
    • uuid

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<UUID> uuid()
      A uuid argument.
      Returns:
      argument
    • objectiveCriteria

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<Criteria> objectiveCriteria()
      An objective criteria argument
      Returns:
      argument
    • entityAnchor

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<LookAnchor> entityAnchor()
      An entity anchor argument.
      Returns:
      argument
    • time

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<Integer> time()
      A time argument, returning the number of ticks.

      Examples:

      • "1d"
      • "5s"
      • "2"
      • "6t"
      Returns:
      argument
    • time

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<Integer> time(int mintime)
      A time argument, returning the number of ticks.

      Examples:

      • "1d"
      • "5s"
      • "2"
      • "6t"
      Parameters:
      mintime - The minimum time required for this argument.
      Returns:
      argument
    • templateMirror

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<Mirror> templateMirror()
      A template mirror argument
      Returns:
      argument
      See Also:
    • templateRotation

      @NotNull public static @NotNull com.mojang.brigadier.arguments.ArgumentType<StructureRotation> templateRotation()
      A template rotation argument.
      Returns:
      argument
      See Also:
    • resource

      @NotNull public static <T> @NotNull com.mojang.brigadier.arguments.ArgumentType<T> resource(@NotNull @NotNull RegistryKey<T> registryKey)
      An argument for a resource in a Registry.
      Type Parameters:
      T - the registry value type
      Parameters:
      registryKey - the registry's key
      Returns:
      argument
    • resourceKey

      @NotNull public static <T> @NotNull com.mojang.brigadier.arguments.ArgumentType<TypedKey<T>> resourceKey(@NotNull @NotNull RegistryKey<T> registryKey)
      An argument for a typed key for a Registry.
      Type Parameters:
      T - the registry value type
      Parameters:
      registryKey - the registry's key
      Returns:
      argument
      See Also: