Class KeyArgumentType
java.lang.Object
net.kyori.adventure.platform.fabric.KeyArgumentType
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<Key>
public final class KeyArgumentType
extends Object
implements com.mojang.brigadier.arguments.ArgumentType<Key>
An argument that will be decoded as a Key.
For this argument type to fully function, adventure-platform-fabric must also be present on the client. Clients without the mod will receive fallback types existing in the base game.
- Since:
- 4.0.0
-
Method Details
-
key
Get an argument type instance forKey
s.- Returns:
- key argument type
- Since:
- 4.0.0
-
key
@NotNull public static @NotNull Key key(@NotNull @NotNull com.mojang.brigadier.context.CommandContext<?> ctx, @NotNull @NotNull String id) Get aKey
-typed value from a parsedCommandContext
.- Parameters:
ctx
- context to get the value fromid
- id the argument was taken from- Returns:
- provided argument
- Since:
- 4.0.0
-
parse
@NotNull public @NotNull Key parse(@NotNull @NotNull com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parse
in interfacecom.mojang.brigadier.arguments.ArgumentType<Key>
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-