Interface Condition
-
@NonExtendable public interface ConditionCommand condition.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default @NotNull Optional<net.kyori.adventure.text.Component>getErrorMessage()Get error message.static @NotNull Conditionof(@NotNull Predicate<Context> test)Create new condition.static @NotNull Conditionof(@NotNull Predicate<Context> test, @NotNull net.kyori.adventure.text.Component errorMessage)Create new condition with an error message.booleantest(@NotNull Context context)Condition test.
-
-
-
Method Detail
-
test
boolean test(@NotNull @NotNull Context context)Condition test.- Parameters:
context- Command execution context.- Returns:
trueif condition passed, otherwisefalse.
-
getErrorMessage
@NotNull default @NotNull Optional<net.kyori.adventure.text.Component> getErrorMessage()
Get error message.- Returns:
- error message if available, otherwise
null.
-
of
@NotNull static @NotNull Condition of(@NotNull @NotNull Predicate<Context> test)
Create new condition.- Parameters:
test- Command condition test.- Returns:
- new condition.
-
of
@NotNull static @NotNull Condition of(@NotNull @NotNull Predicate<Context> test, @NotNull @NotNull net.kyori.adventure.text.Component errorMessage)
Create new condition with an error message.- Parameters:
test- Command condition test.errorMessage- Error message component.- Returns:
- new condition.
-
-