Interface DefaultExpression<T>

All Superinterfaces:
Debuggable, Expression<T>, SyntaxElement
All Known Implementing Classes:
EventValueExpression, ExprCommandSender, ExprDamageCause, ExprInventoryAction, ExprItem, ExprRegion, ExprSpawnReason, ExprTeleportCause, LitAt, LitConsole, LitNewLine, SimpleLiteral

public interface DefaultExpression<T> extends Expression<T>
Represents an expression that can be used as the default value of a certain type and event.
  • Method Details

    • init

      boolean init()
    • isDefault

      boolean isDefault()
      Description copied from interface: Expression
      Returns whether this value represents the default value of its type for the event, i.e. it can be replaced with a call to event.getXyz() if one knows the event & value type.

      This method might be removed in the future as it's better to check whether value == event.getXyz() for every value an expression returns.

      Specified by:
      isDefault in interface Expression<T>
      Returns:
      Usually true, though this is not required, as e.g. SimpleLiteral implements DefaultExpression but is usually not the default of an event.