Class EventResult

java.lang.Object
me.shedaniel.architectury.event.EventResult

public final class EventResult extends Object
A result from an event, determines if the event should continue to other listeners, and determines the outcome of the event.
See Also:
  • Method Details

    • pass

      public static EventResult pass()
      Passes the event to other listeners, and does not set an outcome of the event.
      Returns:
      an event that passes the event to other listeners
    • interrupt

      public static EventResult interrupt(Boolean value)
      Interrupts the event and stops it from being passed on to other listeners, may or may not set an outcome of the event.
      Parameters:
      value - the outcome of the event, passing null here means the default outcome, which often means falling back to vanilla logic
      Returns:
      an event that interrupts the event
    • interruptTrue

      public static EventResult interruptTrue()
      Interrupts the event and stops it from being passed on to other listeners, and denotes the true outcome.
      Returns:
      an event that interrupts the event
    • interruptDefault

      public static EventResult interruptDefault()
      Interrupts the event and stops it from being passed on to other listeners, and does not set an outcome.
      Returns:
      an event that interrupts the event
    • interruptFalse

      public static EventResult interruptFalse()
      Interrupts the event and stops it from being passed on to other listeners, and denotes the false outcome.
      Returns:
      an event that interrupts the event
    • interruptsFurtherEvaluation

      public boolean interruptsFurtherEvaluation()
      Returns whether this result interrupts the evaluation of other listeners.
      Returns:
      whether this result interrupts the evaluation of other listeners
    • value

      public Boolean value()
      Returns the outcome of the result, an passing result will never have an outcome.
      Returns:
      the outcome of the result, returns null if fallback