Including files

Source expansion, nesting and path checks.

Include directives

Place a standalone line inside a Java block or .jv file:

include "shared.jv"

#include "shared.jv" is supported too. The directive requires the .jv suffix. Source is inserted into the current block before compilation; its variables become part of the same method body.

Relative paths

Nested files resolve beside the including file first, then from the Skript scripts root. From modules/welcome.jv, include a sibling as include "shared.jv".

The canonical path must stay within the scripts directory. Traversal or symlinks escaping that directory are rejected.

Cycles and failures

A cycle such as a.jv → b.jv → a.jv rejects preparation of the affected block. During parsing, this can invalidate the script; background preloading logs the failure. It does not mean the whole server is stopped.

Nested includes retain their own filenames and lines for error reports. Do not rely on unlimited depth; keep the include structure small and understandable.

Reload the calling script after modifying an included file.

Type a query to search the guide.