Package ch.njol.skript.lang.function
Class Function<T>
java.lang.Object
ch.njol.skript.lang.function.Function<T>
- All Implemented Interfaces:
Function<T>
- Direct Known Subclasses:
JavaFunction,ScriptFunction
Functions can be called using arguments.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanExecute functions even when some parameters are not present. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract T @Nullable []execute(FunctionEvent<?> event, Object[][] params) Deprecated, for removal: This API element is subject to removal in a future version.final T @Nullable []Deprecated, for removal: This API element is subject to removal in a future version.UseFunction.execute(FunctionEvent, FunctionArguments)instead.getName()Parameter<?> getParameter(int index) Deprecated, for removal: This API element is subject to removal in a future version.UseSignature.parameters()andParameters.get(int)instead.Parameter<?>[]Deprecated, for removal: This API element is subject to removal in a future version.UseSignature.parameters()andParameters.all()instead.Gets signature of this function that contains all metadata about it.booleanisSingle()abstract booleanResets the return value of theFunction.@NotNull String @Nullable []toString()type()
-
Field Details
-
executeWithNulls
public static boolean executeWithNullsExecute functions even when some parameters are not present. Field is updated by SkriptConfig in case of reloads.
-
-
Constructor Details
-
Function
-
-
Method Details
-
getSignature
Gets signature of this function that contains all metadata about it.- Returns:
- A function signature.
-
signature
-
getName
-
getParameters
Deprecated, for removal: This API element is subject to removal in a future version.UseSignature.parameters()andParameters.all()instead. -
getParameter
Deprecated, for removal: This API element is subject to removal in a future version.UseSignature.parameters()andParameters.get(int)instead. -
isSingle
public boolean isSingle() -
getReturnType
-
type
- Returns:
- The return type of this signature. Returns null for no return type.
-
execute
Deprecated, for removal: This API element is subject to removal in a future version.UseFunction.execute(FunctionEvent, FunctionArguments)instead. -
execute
@Deprecated(since="2.14", forRemoval=true) public abstract T @Nullable [] execute(FunctionEvent<?> event, Object[][] params) Deprecated, for removal: This API element is subject to removal in a future version.UseFunction.execute(FunctionEvent, FunctionArguments)instead. -
returnedKeys
- Specified by:
returnedKeysin interfaceFunction<T>- Returns:
- The keys of the values returned by this function, or null if no keys are returned.
-
resetReturnValue
public abstract boolean resetReturnValue()Resets the return value of theFunction. Should be called right after execution.- Specified by:
resetReturnValuein interfaceFunction<T>- Returns:
- Whether or not the return value was successfully reset
-
toString
-
Function.execute(FunctionEvent, FunctionArguments)instead.