Blocks or modules

Choose where to keep your Java code.

Inline event code

Use execute java: for a small fragment belonging to a particular event or command.

on damage:
    execute java:
        if (context.get("victim") instanceof Player) {
            setVar("last_damage", context.get("damage"));
        }

A separate module

Use a .jv file for larger code, reuse, or syntax that is awkward to express through Skript’s node parser.

on join:
    run jv "modules/welcome.jv"

A .jv file is still a Java method body, without package or import declarations. Use fully qualified names for additional types.

Shared behavior

Both modes share the JDK compiler, cache, event context and variable bridge. Compilation is asynchronous; execution stays on the original event thread. A run jv path must be known when the script is parsed.

include "file.jv" inserts source into the current block; run jv executes a separate module. See includes.

Type a query to search the guide.