Class JavaFunction<T>

java.lang.Object
ch.njol.skript.lang.function.Function<T>
ch.njol.skript.lang.function.JavaFunction<T>
Direct Known Subclasses:
SimpleJavaFunction

public abstract class JavaFunction<T> extends Function<T>
  • Constructor Details

  • Method Details

    • execute

      @Nullable public abstract T[] 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).
    • description

      public JavaFunction<T> description(String... description)
      Only used for Skript's documentation.
      Returns:
      This JavaFunction object
    • examples

      public JavaFunction<T> examples(String... examples)
      Only used for Skript's documentation.
      Returns:
      This JavaFunction object
    • keywords

      public JavaFunction<T> keywords(String... keywords)
      Only used for Skript's documentation.
      Parameters:
      keywords -
      Returns:
      This JavaFunction object
    • since

      public JavaFunction<T> since(String since)
      Only used for Skript's documentation.
      Returns:
      This JavaFunction object
    • getDescription

      @Nullable public @Nullable String[] getDescription()
    • getExamples

      @Nullable public @Nullable String[] getExamples()
    • getKeywords

      @Nullable public @Nullable String[] getKeywords()
    • getSince

      @Nullable public @Nullable String getSince()
    • 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