Interface DefaultExpression<T>

All Superinterfaces:
Debuggable, Expression<T>, SyntaxElement
All Known Implementing Classes:
SimpleLiteral

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

    • init

      boolean init()
      Called when an expression is initialized.
      Returns:
      Whether the expression is valid in its context. Skript will error if false.
    • 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 invalid input: '&' 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.