Syntax and bridge helpers

Skript sections, effects, expressions and Java helpers.

Skript elements

Syntax Type Purpose
execute java: Section A Java method body inside a trigger
java callback %string%: Section Named code for a callback
run jv %string% Effect Execute a module
include jv %string% Effect Alias for module execution
getVar %string% Expression Read a variable
setVar %string% to %objects% Effect Write a value or multiple values
end java Effect Compatibility marker with no execution behavior

run jv requires a path known while parsing. The include jv effect executes a separate module; it is different from the source-expansion directive include "file.jv".

Helpers inside Java blocks

Method Result
getVar(String name) Scalar, detached List/Map, or null
setVar(String name, Object value) Write to the selected Skript scope
getList(String name) List<?>; sparse keys require Map
getMap(String name) Map<String, Object>
callback(String name) Runnable
consumer(String name) Consumer<Object>

context.get("name") reads an event binding; context.has("name") checks its presence. event and sender are provided per invocation.

See variables, collections, and callbacks.

Type a query to search the guide.