skJson icon

skJson -----

Working with json in skript




Fix requests 5.1.1
Full Changelog: https://github.com/cooffeeRequired/skJson/compare/5.1...5.1.1

Fix (response|request) body/headers.
- Thank you @Fusezion..
- Rewroten to SimplePropertyExpression
----------, May 6, 2025

Check github
----------, Mar 29, 2024

Working with Json within a literal has been added

as well as improved asynchronous processing for the Request class.

Example of Request

If there is a return in on complete then skjson will recognize that you want to wait for a response, RECOMMENDATION: use this only when you know the server is available.
also in on complete you can execute any code because this section is so called executable
Code (Text):
function test(i: number) :: object:
    async make POST request to "http://localhost:3000/?id=%{_id}%":
        save incorrect response: true
        lenient: true
        save:
            content: {_content}
        on complete:
            return {_content}
local function clear():
    loop 100 times:
        send " " to console
command test <number>:
    trigger:
        loop arg-1 times:
            wait 1 tick
            set {_t} to test(loop-number)
            send {_t}

Literal JSON

you don't need to use [code single]%[/code] before and after the expresseme because SkJson parser recognizes it and passes it to the Script parser. the same goes for strings, if you want to escape use classic json escape for example `\", \r, \t, \n"
Code (Text):
on script load:
    set {_X} to @{"json": true}
    set {_json} to @{id: 10, something: "Test", var: {_X}, string: "\nthis \"new\" Thing"}
    send {_json}

You must enable both of these features in the settings.

Config

Code (Text):
  # Beta features
  features:
    # That feature will you allow use tld. literal string for e.g.
    # @{userId: 1, products: [{id: {_i}, quantity: 1}, {id: {_j}, quantity: 2}]}
    # Inside the Literal string you don't need use a % for evaluate variables or expressions.
    # Also,you don't need to use string escape as like "", you can basically json string escape for e.g.
    # @{test: "This is \"New\" String"}
    # So the literal start always with @ and then continue a with a JSON
    literal-parsing-single-line: true
   
    # This Feature allows you to immediately get the value from the async run of the request.
    # For e.g.
    # function test(i: number) :: object:
    #    async make POST request to "https://dummyjson.com/carts/add":
    #        headers: @{Content-Type: "Application/json"}
    #        headers: json from text "{Content-Type: 'application/json'}"
    #        content: json from text "{userId: 1, products: [{id: %{_i}%, quantity: 1}, {id: 50, quantity: 2}]}"
    #        save incorrect response: true
    #        lenient: true
    #        save:
    #            content: {_content}
    #        on complete:
    #            return {_content}
    #
    # command test <number>:
    #    trigger:
    #        send test(arg-1)
    force-async-return: true
What's Changed
* Main http handing by @cooffeeRequired in https://github.com/SkJsonTeam/skJson/pull/75
* Fixed [code single]/skjson[/code] command
Full Changelog: https://github.com/SkJsonTeam/skJson/compare/2.9.1...2.9.3
----------, Oct 18, 2023

SkJson 2.8.5

Fixed java issue and file writing

Minecraft support:

- 1.13 - 1.16.5,
- 1.16.5-1.20

Skript version:

- 2.7.0 - Beta 1,
- 2.7.0 - Beta 2,
- 2.6.4

What's Changed
Update Reflection.java by @cooffeeRequired in https://github.com/SkJsonTeam/skJson/pull/50


Full Changelog: https://github.com/SkJsonTeam/skJson/compare/2.8.4...2.8.5


Thank everyone for their support for ideas
Sincerely coffeeRequred.

----------, May 16, 2023

SkJson 2.8.3

Doc's updated (SkUnity, SkriptHub)
Skript version:

  • 2.7.0 - Beta 1,
  • 2.7.0 - Beta 2,
  • 2.6.4
Changed
  1. small changes was also in the Execute web request


Code (Text):

(execute|send|make) [new] (<.+>|%-string%) request to %string% [(:with headers) %-strings/json%] [and with (:body|:data) %-strings/json%][/B]
[B](execute|send|make) [new] (<.+>|%-string%) request to %string% [with (:body|:data) %-strings/json%] [and (:with headers) %-strings/json%]
 


Fixed

  1. size of %json% -> json size of %json%, cause old syntax has conflict with vanilla skript
  2. fixed block thread in the async method for sending request's and wriiting to file
Added
  1. Added convertation from .yml files to .json
Code (Text):

set {_yaml json} to json from yaml file "..../test.yaml"[/B][/B]
[B][B]


  1. more properties of request's responses
Code (Text):

[SkJson] [(:current|:previous)] request's (2:body|3:code|4:connection headers|[user] (5:headers)|6:url)[/B][/B]
[B][B][skJson] (2:body|3:code|4:connection headers|[user] (5:headers)|6:url) of [(:current|:previous)] request
 



[​IMG]

[​IMG]

What's Changed

Full Changelog: https://github.com/SkJsonTeam/skJson/compare/2.8.2...2.8.3

Thank everyone for their support for ideas
Sincerely coffeeRequred.


----------, Apr 26, 2023

SkJson - 2.8.2 Small Fixes

Updated examples,
Added examples for JsonChanger,
Also Using @NoDoc for Expression which are only auxiliary,
Also fixed bug which caused that longer strings were not saved to cached json..
Also modified debug system. https://github.com/cooffeeRequired/skJson/releases/tag/2.8.2
----------, Apr 11, 2023

A lot of changes have been made, practically the whole addon is redesigned for performance reasons, some features are added but please read more on Github

View attachment 7377

Thanks CoffeeRequired!
----------, Mar 26, 2023

skJson 2.7.0⚠️
Introduce

Hello everyone.

- Fix small bugs
- Fixed bundles
- Cleanup code
- fix Typos


Example

Code (Text):
{
  "items": [
      {"==":"org.bukkit.inventory.ItemStack","v":3218,"type":"APPLE","meta":{"==":"ItemMeta","meta-type":"UNSPECIFIC","display-name":"{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Tomate\"}],\"text\":\"\"}","custom-model-data":1}},
      {"==":"org.bukkit.inventory.ItemStack","v":3218,"type":"APPLE","meta":{"==":"ItemMeta","meta-type":"UNSPECIFIC","display-name":"{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Tomate2\"}],\"text\":\"\"}","custom-model-data":1}},
      {"==":"org.bukkit.inventory.ItemStack","v":3218,"type":"APPLE","meta":{"==":"ItemMeta","meta-type":"UNSPECIFIC","display-name":"{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Tomate3\"}],\"text\":\"\"}","custom-model-data":1}}

  ],
  "nums": [
    1,
    2,
    3,
    0
  ]
}
Code (Text):
command try:
    trigger:
        set {_} to json from file "items/test.json"
        send {_}
        remove json object player's tool from nested object "items" of {_}
        remove json index 1 from nested object "nums" of {_}
        send {_} with pretty print
````
* Fixed olders issue contains invalid mapping or invalid converting to the json.
* Also fixed issue what should remove the meta from the ItemStack, which should not be removed.
* Also fixed issue with CustomModelData contains id of model was lost from converting to json.
* Path-Hotlinking will not added because it's necessary use that hotlink instead link file instead.
* #13 null as new Data (Bug) was fully fixed -> Will apear error when you tried converting null json to the object.
* #15 fully supported new syntax for remove json from nested object.
* #18 - Item Conversion. When you put item to the Skript list and then you want retrieve it as json form, you got broken json from BukkitSerilization instead of our json normal representation
* #19 UTF-8 encoding error, Fixed
* #20 Item-Data encoding error, Fixed
* #24 Bundle(Custom model Data) lost, Fixed (Minecraft 1.19+)


[b]PLEASE READ THE NEW SYNTAXE'S! on the Skript hub[/b]



 Please check SkriptHub or Wikipedia for syntax changes.
## ❌  If you found any bugs, feel free to post it.

Sincerely, Coffee.

[b]Full Changelog[/b]: https://github.com/cooffeeRequired/skJson/compare/2.6.0...2.7.0[/FONT]
----------, Feb 22, 2023

skJson pre-release 2.7.0⚠️
Introduce

> Hello everyone.

- Fix small bugs #22 #21 #20
- Fixed bundles
- Cleanup code
- fix Typos


Example

Code (Text):
{
  "items": [
      {"==":"org.bukkit.inventory.ItemStack","v":3218,"type":"APPLE","meta":{"==":"ItemMeta","meta-type":"UNSPECIFIC","display-name":"{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Tomate\"}],\"text\":\"\"}","custom-model-data":1}},
      {"==":"org.bukkit.inventory.ItemStack","v":3218,"type":"APPLE","meta":{"==":"ItemMeta","meta-type":"UNSPECIFIC","display-name":"{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Tomate2\"}],\"text\":\"\"}","custom-model-data":1}},
      {"==":"org.bukkit.inventory.ItemStack","v":3218,"type":"APPLE","meta":{"==":"ItemMeta","meta-type":"UNSPECIFIC","display-name":"{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Tomate3\"}],\"text\":\"\"}","custom-model-data":1}}

  ],
  "nums": [
    1,
    2,
    3,
    0
  ]
}
```vb
command try:
trigger:
set {_} to json from file "items/test.json"
send {_}
remove json object player's tool from nested object "items" of {_}
remove json index 1 from nested object "nums" of {_}
send {_} with pretty print
````
Please check SkriptHub or Wikipedia for syntax changes.
❌ If you found any bugs, feel free to post it.

Sincerely, Coffee.

Full Changelog: https://github.com/cooffeeRequired/skJson/compare/2.6.21...pre-release-2.7.0
----------, Feb 18, 2023

skJson 2.6.21⚠️
Introduce
Hello everyone.

New conventors for json.

  • Fix small bugs, #18
  • Cleanup code
  • fix Typos
Fixed.
Code (Text):

command try:
   trigger:
       set {_test::*} to diamond sword named "&aA", apple, stone pickaxe
       broadcast {_test::*}'s form with pretty print

       set {_test::item1} to diamond sword named "&aA"
       set {_test::item2} to stone pickaxe
       set {_test::item3} to apple

       broadcast {_test::*}'s form with pretty print
on load:
   execute console command "try"
 
Please check SkriptHub or Wikipedia for syntax changes.

❌ If you found any bugs, feel free to post it.
Sincerely, Coffee.

Full Changelog: 2.6.2...2.6.21
----------, Feb 1, 2023


skJson 2.6.2⚠️
Introduce

Hello everyone.

- New conventors for json.
- Adding automatic parsing.
- Cleanup code
- fix Typos

From
Code (Text):
command test:
    trigger:
        set {_loc-json} to json from player's location
        set {_loc} to {_loc-json} parsed as a location
        teleport player to {_loc}
To
Code (Text):
command test:
    trigger:
        set {_loc-json} to json from player's location
        teleport player to {_loc-json}
Please check SkriptHub or Wikipedia for syntax changes.
❌ If you found any bugs, feel free to post it.

Sincerely, Coffee.

What's Changed
* New Conventors by @cooffeeRequired in https://github.com/cooffeeRequired/skJson/pull/14

Full Changelog https://github.com/cooffeeRequired/skJson/compare/2.6.1...2.6.2
----------, Jan 25, 2023

skJson 2.6.1⚠️
Introduce

Hello everyone.
Hotfixed issue #11 , also the #13
Also was fixed all mapping / append / write issues.

Please check SkriptHub or Wikipedia for syntax changes.
## ❌ If you found any bugs, feel free to post it.

Sincerely, Coffee.

Full Changelog: https://github.com/cooffeeRequired/skJson/compare/2.5.9...2.6.1
----------, Jan 23, 2023

skJson 2.5.9 ⚠️

I ntroduce

Hello everyone.
Fixed changers, for json you are now able to remove/add or set objects even with cached json.
Added removing/setting for nested objects

This error was related to this thread #8


Version 2.5.9
Example

Code (Text):

on load:
    set {_json} to json from string "{'A': [1,2,3,4,{'B':false}]}"
    set json value "A[1]" of {_json} to true
   
    # Before {"A":[1,2,3,4,{"B":false}]}
   
    remove json value "A[4]:B" from {_json}
    add values 1,2,3,4 to {_json}
    send {_json}
   
    # After {"A":[1,2,3,4,{}]}

    load json file "try3.json" as "try"
    send cached json "try"
    set json value "A[0]" of cached json "try" to true
    send cached json "try"
 
Please check SkriptHub or Wikipedia for syntax changes.
❌ If you found any bugs, feel free to post it.

Sincerely, Coffee.

Full Changelog: https://github.com/cooffeeRequired/skJson/compare/2.5...2.5.9
----------, Jan 21, 2023

skJson 2.5 ⚠️
Introduce

Hello everyone.
This is a big milestone for skJson addon (*skript-gson*)
One of the first pieces of information is that it has been renamed from the current skript-gson to skJson. I renamed this addon because the gson in the name said little to anyone and was not as representative. thus skJson contains both json in the word and Skript (sk)

I should also mention that support for older versions of minecraft server has been added. Since version 1.8.8 this addon is able to work.

I must also mention that the kernels for file handling and json serialization have been redesigned. For example, you can now serialize nbt and or entities.

A lot of syntax has been modified and simplified. one of my favorites is the Append effect, here is an example
Code (Text):
append player's tool with key uuid of player as nested object "data:players tools[1]" to json file "..."
Don't worry I'll show you everything here, the new syntax is more intiative and I hope you'll find it easier to work with this addon, at the moment the addon supports around 24/25 data-types, if you want to add some that isn't just create a github thread as suggestion and I'll be happy to take a look.

I would also like to thank the total number of support and downloads for this addon and that is 4129x to date.

Alright let's get on with the news.

News

Adapters ⏺️

NBT, Entity, Chunk, ItemStack, World, Inventory, bukkit-types, and some Skript-types.

Please check SkriptHub or Wikipedia for syntax changes.

Sincerely, Coffee.

Full Changelog: https://github.com/cooffeeRequired/skJson/compare/2.1.1...2.5
----------, Jan 20, 2023

Hello everyone

Hi there we have a couple of changes regarding the new json from the request, also changes in the Versioning Area and its automatic updates.

Thank you all for your attention.
Sincerely Coffee.

Full Changelog: https://github.com/cooffeeRequired/skript-gson/compare/2.0.4...2.1.0
----------, Jan 3, 2023

skript-gson 2.0.4
[​IMG]


Hello everyone
Changed internal object mapping for Items, now you are able to pull Item from mapped json as well
Code (Text):

command saveinv:
    trigger:
        set {inv} to json from player's inventory

command listinv:
    trigger:
        map {inv} to {_inv::*}
        loop (indices of {_inv::contents::*}):
            if {_inv::contents::%loop-value%::*} is set:
                set {_item} to {_inv::contents::%loop-value%::*}'s form parsed as skript-type
                give {_item} to "player's name" parsed as player

 


Thank you all for your attention.
Sincerely Coffee.

FTW skript-gson

Full Changelog: https://github.com/cooffeeRequired/skript-gson/compare/2.0.3...2.0.4
----------, Jan 2, 2023

skript-gson 2.0.3 [​IMG]

  • Hello everyone Addon

Thank you all for your attention.
Sincerely Coffee.
FTW skript-gson

Full Changelog: https://github.com/cooffeeRequired/skript-gson/compare/2.0.2...2.0.3
----------, Dec 23, 2022

added - All json elements from %jsonelement%
----------, Dec 18, 2022

skript-gson 2.0.2

[​IMG]

  • Hello everyone

Addon

  • ♾️ Fixed: ExprSkriptCollectionToJson.class
  • ♾️ Fixed: JsonElementType.class

Code (Text):
set {_json} to new json from string "{'A': {}, 'B': [], 'C': {'G': {}}}"
add false to {_json}                      # example 1
add "A:test;false" to {_json}          # example 2
add "C:G:test;A" to {_json}            # example 3
Code (Text):
# Show case 1
{"A": {}, "B": [], "C": {"G": {}}, "3": false}
# Show case 2
{"A": {"test": false}, "B": [], "C": {"G": {}}}
# Show case 3
{"A": {}, "B": [], "C": {"G": {"test": "A"}}}
  • ♾️ Fixed: MapJson.class
  • ♾️ Sanitized: All syntaxes..
Thank you all for your attention.
Sincerely Coffee.


FTW skript-gson

Full Changelog: https://github.com/cooffeeRequired/skript-gson/compare/2.0.0...2.0.2
----------, Dec 18, 2022

New release of skript-gson it's out. 2.0.0 Fixed all known mapping bugs, also added SkriptTypes and Bukkit type conversion, also Inventory. Changed functionality and loaded Json as a custom ID, etc. https://skripthub.net/docs/?addon=skript-gson https://github.com/cooffeeRequired/skript-gson/releases/tag/2.0.0
----------, Dec 13, 2022

Skript-Gson 1.4.0

[​IMG]

  • Hello everyone
  • demonstration of this version

    Code (Text):

    on script load:
        load json file "gson/test.json" as "gson"
        set {-file} to "gson/test.json"

    command saveloc [<string>]:
        trigger:
            append data (player's location) with key arg-1 to json file {-file}
            send "Location &8(&e%player's location%&e)&r saved in the json File."

    command teleport:
        trigger:
            set {_} to element "test" from json (loaded json "gson")
            send "Teleporting player to Location &8'&etest&8'"
            teleport player to {_}
     
    more on git Hub..

    Thank you all for your attention.
    Sincerely Coffee.


    FTW skript-gson

    https://github.com/cooffeeRequired/skript-gson/releases/tag/1.4.0
----------, Dec 4, 2022

  • Fixed writing to file...
----------, Dec 3, 2022

Skript-Gson 1.3.3 [​IMG]
  • Hello everyone
Addon

Thank you all for your attention.
Sincerely Coffee.
FTW Skript-Gson
[b

]Full Changelog[/b]: https://github.com/cooffeeRequired/skript-gson/compare/1.3.0...1.3.3
----------, Nov 30, 2022

Docs
Addon
Thank you all for your attention. Sincerely Coffee. FTW Skript-Gson Full Changelog: https://github.com/cooffeeRequired/skript-gson/compare/1.2.2...1.3.1
----------, Nov 24, 2022

Skript-Gson 1.3.0 [​IMG] Docs
Addon
Thank you all for your attention. Sincerely Coffee. FTW Skript-Gson Full Changelog: https://github.com/cooffeeRequired/skript-gson/compare/1.2.2...1.3.0




[COLOR=rgba(0, 0, 0, 0.87)][/COLOR]
----------, Nov 21, 2022

Thank you all for your attention.
Sincerely Coffee.

FTW Skript-Gson

Full Changelog: https://github.com/cooffeeRequired/skript-gson/compare/1.2.2...1.3.0
----------, Nov 20, 2022

https://github.com/cooffeeRequired/skript-gson/releases

Skript-Gson 1.2.0

Hello everyone
This patch won't please some of you, mainly because after reaching the 50th download milestone we noticed that few people know how Non-Literal Json means [code single]json ...[/code] works.

So we decided to remove this feature and work on improvements in putting and adding to the Json file/variable.
The last version is rather a mess and so this version will be cleaned of all necessities plus the examples will be corrected so that the layman can understand them

Format
Finished: [code single]ExprNewJson.class[/code]
Code (Text):
[a] [new] json from [(text|string|request)] %object%
Removed: [code single]Non-Literal from ExprNewJson.class[/code]
Added: serialization\deserialization for [code single]ItemTypes,BlockData[/code] etc.. More here

Expressions
Finished: [code single]ExprJsonListToJsonElement.class[/code] -> Fixed working with objects, now you can change the whole variable.
Added: [code single]ExprCountOfJson.class[/code]
Code (Text):
[a] count of [key] %string% in %jsonelement%
Added: [code single]ExprJsonRegexMatch.class[/code]
Code (Text):
[json] %jsonelement% [regex] match[es] %string%
♾️ Change/Fix: [code single]ExprLoadJsonFile.class[/code] -> At this moment i cannot guarantee the syntax

Effects
♾️ Planed: [code single]EffHandleJsonFile.class[/code]
Code (Text):
load json file %string% as id %string%
unload json file [id] %string%
save json file [id] %string%
♾️ Planed-Rework: [code single]EffMapJsonToList.class[/code] -> will contains new feature.
♾️ Planed-Rework: [code single]EffWriteToFile.class[/code] -> will contains new feature.

Conditions
Added: [code single]CondJsonHas.class[/code]
Code (Text):
%jsonelement% has (:key|:value) %objects%
%jsonelement% has list (:keys|:values) %objects%
♾️ Planed-Rework: [code single]CondJsonValueObject.class[/code]
Code (Text):
[a] value %string% in %jsonelement% is (:true|:false)
[a] value %string% in %jsonelement% is string
[a] value %string% in %jsonelement% is integer
[a] value %string% in %jsonelement% is boolean
[a] value %string% in %jsonelement% can be parsed
Thank you all for your attention. \
Sincerely Coffee.

FTW *Skript-Gson*
*
----------, Nov 10, 2022

Git.png

Hello everyone

This patch fixes bugs #1, #2 and also fixes a syntax error where you couldn't use variables for example in
Code (Text):
'append.. '
Change from
Code (Text):
...

  "[a] [new] json from (string|text) %string%",
  "[a] [new] json from file [path] %string%",
  "json (([<.+>])|({<.+>}))",
  "(<'.+'>)"

...
On \

Code (Text):
...

"[a] [new] json from (string|text) %string%",
"[a] [new] json from file [path] %string%",
"(json ((<\\[.*\\]>)|(<\\{.*\\}>)|((\\\"|')<.+>(\\\"|'))|(<(true|false)>)))"

...

Also added a new substring \

Code (Text):
[a] json file %object% is exist
----------, Nov 6, 2022




Skript-Gson 1.1.0

This this realese brings new features such as.
Expressions

  • (load|open)[ed] json file %string%

Effects

  • write [new] data %jsonelement% to [json] file %object%

  • append(ing|) [new] data %jsonelement% to [json] file %object% [:)as) [nested] object %-jsonelement% [:)with) [property] key %-string/integer%]]

Full Changelog: https://github.com/cooffeeRequired/skript-gson/compare/1.0.2-Beta...1.1.0
----------, Nov 6, 2022


Fixed typo
----------, Nov 1, 2022

Resource Information
Author:
----------
Total Downloads: 3,591
First Release: Oct 31, 2022
Last Update: May 6, 2025
Category: ---------------
All-Time Rating:
4 ratings
Find more info at github.com...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings