Class ScriptFunction<T>

java.lang.Object
ch.njol.skript.lang.function.Function<T>
ch.njol.skript.lang.function.ScriptFunction<T>
All Implemented Interfaces:
ReturnHandler<T>

public class ScriptFunction<T> extends Function<T> implements ReturnHandler<T>
  • Constructor Details

  • Method Details

    • execute

      public T @Nullable [] execute(FunctionEvent<?> e, Object[][] params)
      Description copied from class: Function
      Executes this function with given parameters. Usually, using Function.execute(Object[][]) is better; it handles optional arguments and function event creation automatically.
      Specified by:
      execute in class Function<T>
      Parameters:
      e - Associated function event. This is usually created by Skript.
      params - Function parameters. There must be Signature.getMaxParameters() amount of them, and you need to manually handle default values.
      Returns:
      Function return value(s).
    • setReturnValue

      @Deprecated @Internal public final void setReturnValue(@Nullable T[] values)
    • resetReturnValue

      public boolean resetReturnValue()
      Description copied from class: Function
      Resets the return value of the Function. Should be called right after execution.
      Specified by:
      resetReturnValue in class Function<T>
      Returns:
      Whether or not the return value was successfully reset
    • returnValues

      public final void returnValues(org.bukkit.event.Event event, Expression<? extends T> value)
      Description copied from interface: ReturnHandler
      Called when EffReturn is executed
      Specified by:
      returnValues in interface ReturnHandler<T>
      Parameters:
      event - the event providing context
      value - an expression representing the value(s) to return
    • isSingleReturnValue

      public final boolean isSingleReturnValue()
      Specified by:
      isSingleReturnValue in interface ReturnHandler<T>
      Returns:
      whether this return handler may accept multiple return values
    • returnValueType

      public final @Nullable Class<? extends T> returnValueType()
      Description copied from interface: ReturnHandler
      The return type of this return handler, or null if it can't accept return values in this context (e.g. a function without a return type).
      Specified by:
      returnValueType in interface ReturnHandler<T>
      Returns:
      the return type