Class ArgumentTypes
java.lang.Object
io.papermc.paper.command.brigadier.argument.ArgumentTypes
Vanilla Minecraft includes several custom
ArgumentType
s 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 Summary
Modifier and TypeMethodDescriptionstatic com.mojang.brigadier.arguments.ArgumentType
<BlockPositionResolver> A block position argument.static com.mojang.brigadier.arguments.ArgumentType
<BlockState> A blockstate argument which will provide rich parsing for specifying the specific block variant and then the block entity NBT if applicable.static com.mojang.brigadier.arguments.ArgumentType
<Component> A component argument.static com.mojang.brigadier.arguments.ArgumentType
<DoubleRangeProvider> An inclusive range of doubles that may be unbounded on either end.static com.mojang.brigadier.arguments.ArgumentType
<EntitySelectorArgumentResolver> entities()
Represents a selector that can capture multiple entities.static com.mojang.brigadier.arguments.ArgumentType
<EntitySelectorArgumentResolver> entity()
Represents a selector that can capture any single entity.static com.mojang.brigadier.arguments.ArgumentType
<LookAnchor> An entity anchor argument.static com.mojang.brigadier.arguments.ArgumentType
<FinePositionResolver> A fine position argument.static com.mojang.brigadier.arguments.ArgumentType
<FinePositionResolver> finePosition
(boolean centerIntegers) A fine position argument.static com.mojang.brigadier.arguments.ArgumentType
<GameMode> gameMode()
A game mode argument.static com.mojang.brigadier.arguments.ArgumentType
<HeightMap> An argument for getting a heightmap type.static com.mojang.brigadier.arguments.ArgumentType
<IntegerRangeProvider> An inclusive range of integers that may be unbounded on either end.static com.mojang.brigadier.arguments.ArgumentType
<ItemStackPredicate> An item predicate argument.static com.mojang.brigadier.arguments.ArgumentType
<ItemStack> An ItemStack argument which provides rich parsing for specifying item material and item NBT information.static com.mojang.brigadier.arguments.ArgumentType
<Key> key()
A key argument.static com.mojang.brigadier.arguments.ArgumentType
<NamedTextColor> An argument for parsingNamedTextColor
s.static com.mojang.brigadier.arguments.ArgumentType
<NamespacedKey> A namespaced key argument.static com.mojang.brigadier.arguments.ArgumentType
<Criteria> An objective criteria argumentstatic com.mojang.brigadier.arguments.ArgumentType
<PlayerSelectorArgumentResolver> player()
Represents a selector that can capture a singular player entity.static com.mojang.brigadier.arguments.ArgumentType
<PlayerProfileListResolver> A selector argument that provides a list of player profiles.static com.mojang.brigadier.arguments.ArgumentType
<PlayerSelectorArgumentResolver> players()
Represents a selector that can capture multiple player entities.static <T> com.mojang.brigadier.arguments.ArgumentType
<T> resource
(RegistryKey<T> registryKey) An argument for a resource in aRegistry
.static <T> com.mojang.brigadier.arguments.ArgumentType
<TypedKey<T>> resourceKey
(RegistryKey<T> registryKey) An argument for a typed key for aRegistry
.static com.mojang.brigadier.arguments.ArgumentType
<DisplaySlot> A scoreboard display slot argument.static com.mojang.brigadier.arguments.ArgumentType
<SignedMessageResolver> A signed message argument.static com.mojang.brigadier.arguments.ArgumentType
<Style> style()
A style argument.static com.mojang.brigadier.arguments.ArgumentType
<Mirror> A template mirror argumentstatic com.mojang.brigadier.arguments.ArgumentType
<StructureRotation> A template rotation argument.static com.mojang.brigadier.arguments.ArgumentType
<Integer> time()
A time argument, returning the number of ticks.static com.mojang.brigadier.arguments.ArgumentType
<Integer> time
(int mintime) A time argument, returning the number of ticks.static com.mojang.brigadier.arguments.ArgumentType
<UUID> uuid()
A uuid argument.static com.mojang.brigadier.arguments.ArgumentType
<World> world()
A world argument.
-
Method Details
-
entity
Represents a selector that can capture any single entity.- Returns:
- argument that takes one entity
-
entities
public static com.mojang.brigadier.arguments.ArgumentType<EntitySelectorArgumentResolver> entities()Represents a selector that can capture multiple entities.- Returns:
- argument that takes multiple entities
-
player
Represents a selector that can capture a singular player entity.- Returns:
- argument that takes one player
-
players
Represents a selector that can capture multiple player entities.- Returns:
- argument that takes multiple players
-
playerProfiles
public static com.mojang.brigadier.arguments.ArgumentType<PlayerProfileListResolver> playerProfiles()A selector argument that provides a list of player profiles.- Returns:
- player profile argument
-
blockPosition
A block position argument.- Returns:
- block position argument
-
finePosition
A fine position argument.- Returns:
- fine position argument
- See Also:
-
finePosition
public static com.mojang.brigadier.arguments.ArgumentType<FinePositionResolver> finePosition(boolean centerIntegers) A fine position argument.- Parameters:
centerIntegers
- if whole numbers should be centered (+0.5)- Returns:
- fine position argument
-
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
An ItemStack argument which provides rich parsing for specifying item material and item NBT information.- Returns:
- argument
-
itemPredicate
An item predicate argument.- Returns:
- argument
-
namedColor
An argument for parsingNamedTextColor
s.- Returns:
- argument
-
component
A component argument.- Returns:
- argument
-
style
A style argument.- Returns:
- argument
-
signedMessage
A signed message argument. This argument can be resolved to retrieve the underlying signed message.- Returns:
- argument
-
scoreboardDisplaySlot
A scoreboard display slot argument.- Returns:
- argument
-
namespacedKey
A namespaced key argument.- Returns:
- argument
-
key
A key argument.- Returns:
- argument
-
integerRange
An inclusive range of integers that may be unbounded on either end.- Returns:
- argument
-
doubleRange
An inclusive range of doubles that may be unbounded on either end.- Returns:
- argument
-
world
A world argument.- Returns:
- argument
-
gameMode
A game mode argument.- Returns:
- argument
-
heightMap
An argument for getting a heightmap type.- Returns:
- argument
-
uuid
A uuid argument.- Returns:
- argument
-
objectiveCriteria
An objective criteria argument- Returns:
- argument
-
entityAnchor
An entity anchor argument.- Returns:
- argument
-
time
A time argument, returning the number of ticks.Examples:
- "1d"
- "5s"
- "2"
- "6t"
- Returns:
- argument
-
time
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
A template mirror argument- Returns:
- argument
- See Also:
-
templateRotation
A template rotation argument.- Returns:
- argument
- See Also:
-
resource
public static <T> com.mojang.brigadier.arguments.ArgumentType<T> resource(RegistryKey<T> registryKey) An argument for a resource in aRegistry
.- Type Parameters:
T
- the registry value type- Parameters:
registryKey
- the registry's key- Returns:
- argument
-
resourceKey
public static <T> com.mojang.brigadier.arguments.ArgumentType<TypedKey<T>> resourceKey(RegistryKey<T> registryKey) An argument for a typed key for aRegistry
.- Type Parameters:
T
- the registry value type- Parameters:
registryKey
- the registry's key- Returns:
- argument
- See Also:
-