Class Condition

All Implemented Interfaces:
Debuggable, SyntaxElement

public abstract class Condition extends Statement
A condition which must be fulfilled for the trigger to continue. If the condition is in a section the behaviour depends on the section.
See Also:
  • Constructor Details

    • Condition

      protected Condition()
  • Method Details

    • check

      public abstract boolean check(org.bukkit.event.Event event)
      Checks whether this condition is satisfied with the given event. This should not alter the event or the world in any way, as conditions are only checked until one returns false. All subsequent conditions of the same trigger will then be omitted.

      You might want to use SimpleExpression.check(Event, Checker)
      Parameters:
      event - the event to check
      Returns:
      true if the condition is satisfied, false otherwise or if the condition doesn't apply to this event.
    • run

      public final boolean run(org.bukkit.event.Event event)
      Description copied from class: TriggerItem
      Executes this item.
      Specified by:
      run in class TriggerItem
      Parameters:
      event - The event to run this item with
      Returns:
      True if the next item should be run, or false for the item following this item's parent.
    • setNegated

      protected final void setNegated(boolean invert)
      Sets the negation state of this condition. This will change the behaviour of Expression.check(Event, Checker, boolean).
    • isNegated

      public final boolean isNegated()
      Returns:
      whether this condition is negated or not.
    • parse

      @Nullable public static @Nullable Condition parse(String input, @Nullable @Nullable String defaultError)