Skip to content

🚀 This new wiki is in beta! Please double-check for any issue and report them on the GitHub

Parsing Full Scripts

The classic eval effect only handles statements — effects and conditions, the kind of code you find inside a trigger. It cannot understand structural lines like on join:, command /hello: or function greet():.

The parse script effect lifts that limitation. It runs the complete Skript loading pipeline — exactly like Skript does when it loads a .sk file — so it can parse and validate whole scripts, including:

  • Events (on join:, on death:, …)
  • Commands (command /hello:)
  • Functions (function greet(p: player):)
  • Options, and every other script structure

Each error and warning is returned as a structured parse entry carrying its line number, level and message — ideal for building linters, code editors or validation systems.

evalparse script
Handles statements (effects/conditions)
Handles events, commands, functions
Error outputplain textstructured parse entries (line, level, message)
Added in1.01.3.0
parse [without loading] [the] script %string% [and store [the] (error|result|entries) in %-objects%]
ParameterTypeRequiredDescription
%string%StringYesThe complete Skript code to parse
without loadingFlagNoValidate only — do not register or run anything
%-objects%ListNoVariable to store the resulting parse entries

The effect has two modes, controlled by the optional without loading flag.

parse without loading the script {_code} and store the errors in {_errors::*}

The script is fully parsed to collect every error and warning, then immediately unloaded. Nothing is registered, executed or kept active — no event listeners, no commands, no functions. This is the safe choice for validating untrusted or user-submitted code.

The effect stores its result as a list of parse entries (the parse entry type). A parse entry exposes four pieces of information through dedicated expressions:

parse line of %parse entry% # the line number (number), or -1 if unknown
parse level of %parse entry% # "error" or "warning" (text)
parse message of %parse entry% # the human-readable description (text)
parse source code of %parse entry% # the offending source line (text)

Printing a parse entry directly gives a ready-made summary, e.g. [error] line 3: Can't understand this effect: ....

ExpressionReturnsDescription
parse line ofNumberLine the entry refers to (-1 if unknown)
parse level ofText"error" or "warning"
parse message ofTextThe description of the problem
parse source code ofTextThe source line that triggered the entry

Check a full script — event header included — before doing anything with it:

command /checkscript:
trigger:
# A complete script, with an event, not just statements
set {_lines::*} to "on join:"
add " send ""Welcome!"" to player" to {_lines::*}
add " set {joined::%player's uuid%} to now" to {_lines::*}
set {_code} to join {_lines::*} with nl
parse without loading the script {_code} and store the errors in {_errors::*}
if {_errors::*} is not set:
send "&aThe script is valid!"
else:
send "&cThe script has %size of {_errors::*}% problem(s)."

Use the parse entry expressions to build a precise, linter-style report:

parse without loading the script {_code} and store the errors in {_entries::*}
loop {_entries::*}:
set {_entry} to loop-value
if parse level of {_entry} is "error":
send "&c✗ line %parse line of {_entry}%: %parse message of {_entry}%"
send "&7 ┗ %parse source code of {_entry}%"
else:
send "&e⚠ line %parse line of {_entry}%: %parse message of {_entry}%"

Without the without loading flag, the script is registered for real:

command /deploy <text>:
permission: admin.deploy
trigger:
set {_code} to {scripts::%arg-1%}
# Validate first...
parse without loading the script {_code} and store the errors in {_errors::*}
if {_errors::*} is set:
send "&cDeployment aborted — the script has errors."
stop
# ...then load it for real (events, commands and functions become active)
parse the script {_code}
send "&aScript '%arg-1%' deployed and active!"

A Discord command that validates whole scripts and reports each problem with its line:

discord command validate <text>:
prefixes: !
trigger:
parse without loading the script arg-1 and store the errors in {_entries::*}
if {_entries::*} is not set:
make embed:
set title of embed to "✅ Valid Script"
set description of embed to "No errors or warnings found!"
set color of embed to green
reply with last embed
stop
set {_report::*} to ""
loop {_entries::*}:
add "[%parse level of loop-value%] line %parse line of loop-value%: %parse message of loop-value%" to {_report::*}
make embed:
set title of embed to "❌ Script Problems"
set description of embed to "```%nl%%join {_report::*} with nl%%nl%```"
set color of embed to red
reply with last embed
parse [without loading] [the] script %string% [and store [the] (error|result|entries) in %-objects%]
parse line of %parse entries%
parse level of %parse entries%
parse message of %parse entries%
parse source code of %parse entries%

parse entry — a single error or warning produced by the parse script effect.

Need help with ParseSK?