Availability
This page applies only when Skript is installed on the server.
Since v1.2.0, Schema-Validator can start without Skript. When Skript is absent, none of the syntax on this page is registered.
Registered syntax
Effects
validate yaml %string% using schema %string%
validate json %string% using schema %string%
Expression
last schema validation errors
Source: SkriptSyntaxRegistration.register().
Parameter semantics
The effect accepts two string arguments:
- data file path
- schema file path
At runtime these are converted with Path.of(...) in EffValidateData.
[!NOTE] Paths are not automatically prefixed with the plugin data folder. Use explicit paths from server root (for example
plugins/Schema-Validator/...) to avoid path confusion.
Execution behavior
On each effect execution (EffValidateData.execute):
- Data file is loaded via
DataFileLoader. - Schema file is loaded via
FileSchemaLoader. - Loaded schema is registered in
SchemaRegistryby file name. - Validation runs through
ValidationService. - Result is stored in
SkriptValidationBridge.
Reading errors
last schema validation errors returns a String[] where each entry is compact and path-aware.
If there is no last result or validation succeeded, the expression returns an empty array.
Compact message format:
[nodePath] expectedType: actualType - description
Known constraints
- Data loader currently deserializes root payload as
Map<String, Object>. - Bridge state is global and stores only the latest validation result.
Minimal practical command
command /validatesample:
trigger:
validate yaml "plugins/Schema-Validator/examples/simple-block-example.yml" using schema "plugins/Schema-Validator/examples/schemas/simple-block-schema.json"
set {_errors::*} to last schema validation errors
if size of {_errors::*} is 0:
send "Validation passed" to player
else:
loop {_errors::*}:
send "- %loop-value%" to player
Related pages
- Public programmatic entry point: Java API
- Administrative command entry point: Commands
- Runtime validation details: Validation behavior
- Keyword support scope: Schema keywords