Skip to content
JSON support for Skript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src/main Use SkriptDoclet for documentation Dec 17, 2017
tools Use SkriptDoclet for documentation Dec 17, 2017
.editorconfig Initial commit Feb 20, 2017
.gitignore Initial commit Feb 20, 2017
LICENSE Initial commit Feb 20, 2017
README.md Use SkriptDoclet for documentation Dec 17, 2017
build.gradle Use SkriptDoclet for documentation Dec 17, 2017
gradlew Initial commit Feb 20, 2017
gradlew.bat Initial commit Feb 20, 2017
settings.gradle Initial commit Feb 20, 2017

README.md

skript-json

Idiomatic JSON integration for Skript. Convert JSON into list variables and vice versa.


Effect Map JSON to Variable

Copies JSON formatted text into a list variable. Existing entries in the list variable are not deleted.

Syntax

(map|copy) [the] json [(of|from)] %text% to [the] [var[iable]] %list variable%"

Expression JSON Form => text

Converts a list variable into JSON form.

Syntax

[the] [serialized] json (form|representation) of %list variable%
%list variable%'[s] [serialized] json (form|representation)

Structure

If the following JSON were mapped to a variable {json::*}

{
  "foo": 15,
  "bar": "test",
  "baz": {
    "foobar": [
      {
        "quux": false
      }
    ]
  }
}

the following assertions would be true:

{json::foo} is 15
{json::bar} is "test"
{json::baz} is true                    # special case
{json::baz::foobar} is true            # special case
{json::baz::foobar::1} is true         # special case
{json::baz::foobar::1::quux} is false

The variables marked # special case contain nested JSON objects and are true so Skript can properly loop through the variable. These variables (like {json::baz}, not list variables like {json::baz::*}) can be deleted and the structure will still properly serialize into JSON.

Contributing

Feel free to submit pull requests, just make sure your changes are consistent with Google's Java code style!

You can’t perform that action at this time.