Class Function<T>

Direct Known Subclasses:
JavaFunction, ScriptFunction

public abstract class Function<T> extends Object
Functions can be called using arguments.
  • Field Details

    • executeWithNulls

      public static boolean executeWithNulls
      Execute functions even when some parameters are not present. Field is updated by SkriptConfig in case of reloads.
  • Constructor Details

  • Method Details

    • getSignature

      public Signature<T> getSignature()
      Gets signature of this function that contains all metadata about it.
      A function signature.
    • getName

      public String getName()
    • getParameters

      public Parameter<?>[] getParameters()
    • getParameter

      public Parameter<?> getParameter(int index)
    • isSingle

      public boolean isSingle()
    • getReturnType

      public @Nullable ClassInfo<T> getReturnType()
    • execute

      public final @Nullable T[] execute(Object[][] params)
      Executes this function with given parameter.
      params - Function parameters. Must contain at least Signature.getMinParameters() elements and at most Signature.getMaxParameters() elements.
      The result(s) of this function
    • execute

      public abstract @Nullable T[] execute(FunctionEvent<?> e, Object[][] params)
      Executes this function with given parameters. Usually, using execute(Object[][]) is better; it handles optional arguments and function event creation automatically.
      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.
      Function return value(s).
    • resetReturnValue

      public abstract boolean resetReturnValue()
      Resets the return value of the Function. Should be called right after execution.
      Whether or not the return value was successfully reset
    • toString

      public String toString()
      toString in class Object