Class ArgumentTime
java.lang.Object
net.minestom.server.command.builder.arguments.Argument<Duration>
net.minestom.server.command.builder.arguments.minecraft.ArgumentTime
Represents an argument giving a time (day/second/tick).
Example: 50d, 25s, 75t
-
Field Summary
Fields inherited from class net.minestom.server.command.builder.arguments.Argument
allowSpace, CONTAINER, suggestionType, useRemaining
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull ArgumentTime
min
(int min) byte @Nullable []
@NotNull Duration
parse
(@NotNull CommandSender sender, @NotNull String input) Parses the given input, and throw anArgumentSyntaxException
if the input cannot be converted toT
parser()
toString()
Methods inherited from class net.minestom.server.command.builder.arguments.Argument
allowSpace, equals, filter, getCallback, getDefaultValue, getId, getSuggestionCallback, hasErrorCallback, hashCode, hasSuggestion, isOptional, map, map, parse, setCallback, setDefaultValue, setDefaultValue, setDefaultValue, setSuggestionCallback, suggestionType, useRemaining
-
Field Details
-
INVALID_TIME_FORMAT
public static final int INVALID_TIME_FORMAT- See Also:
-
NO_NUMBER
public static final int NO_NUMBER- See Also:
-
-
Constructor Details
-
ArgumentTime
-
-
Method Details
-
min
-
parse
@NotNull public @NotNull Duration parse(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String input) throws ArgumentSyntaxException Description copied from class:Argument
Parses the given input, and throw anArgumentSyntaxException
if the input cannot be converted toT
- Specified by:
parse
in classArgument<Duration>
- Parameters:
input
- the argument to parse- Returns:
- the parsed argument
- Throws:
ArgumentSyntaxException
- ifvalue
is not valid
-
nodeProperties
public byte @Nullable [] nodeProperties()- Overrides:
nodeProperties
in classArgument<Duration>
-
parser
-
toString
-