skJson

Addon skJson 3.0.2-IO

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

SkJson 2.8 (latest 2.8.6) Legacy
This is legacy version fro Skript 2.6.3 +

We have created our own documentation page for SkJson, on this page we will be able to post thready where you can share your code https://www.skjson.xyz/snippests, we also have documentation for both versions with examples. The documentation is automatically updated! Let's get started on the changes!

Condition
* Json file exists
* Json file is cached
* Json file is empty
* Json file is listening
* Json has value/key
* Json is empty
* Type of json

Expressions

* All cached jsons
* Array or List formatted to JSON.
* Count of objects/phrases
* Elements/Values of the json
* Get cached json
* Get last response
* Json size of given Json
* New json
* Pretty json

Effects
* Execute a http request
* JsonWatcher - Start listening to file
* JsonWatcher - Stop listening to file
* Link json file with defined cache.
* Map json to skript list
* New json file
* Save cached json to file
* UnLink or Unload json file
* Write json file with contents
* change json file
* link and load all json files from given folder

Functions
* jsonfile

Types
* json element
* json file

Changers
* Default changer of skJson (SET/REMOVE/ADD)


Resolved Issues.
* #71
* #64
* #63
* #42
* #41
* #39
* #38
* #37
* #24
* #22
* #21
* #20
* #19
* So one...

Special thanks...
I would like to thank everyone who participated in testing and trying out all sorts of features, and especially I would like to thank those who reported all the bugs!

Thank again! (@MinecraftNight4, @yhdev7935, @ExCorde, @Nocky, @welormit, @Envizar, @RedstoneGamer54)

@!Legacy
SkJson 2.9

It's finally here, we have finally seen a fully stable version of SkJson, i.e. version 2.9 which introduced SkJson in the biggest steam, A lot of changes have been made from the ground up.

We have created our own documentation page for SkJson, on this page we will be able to post thready where you can share your code https://www.skjson.xyz/snippests, we also have documentation for both versions with examples. The documentation is automatically updated! Let's get started on the changes!

Condition
* Json file exist
* Json file is cached
* Json file is listening
* Json has value/key
* Json is empty
* Type of json

Expressions
* Count value/key in the Json.
* Get cached json
* Get index of key/value in (ListObject)
* Literals
* Loops
* New Json
* Pretty print
* Size of json object/array
* Skript variable to Json
* Value of JSON

Effects
* Change json file contents
* Json (virtual) storage [lon-linked]
* Json to Skript variable list
* JsonWatcher - Start/Stop listening to file
* Link json file with defined cache
* New json file with/out content
* Save cached json to file
* Unlink or unload json file from cache
* Write content to json file
* link and load all json files from given folder

Events
* watcher[/i]save]Json watcher save

Sections
* Http requests (All methods includes)
* Webhooks (Discord/Web)

Functions
* b64 (Decoding from String to B64)
* skjson_getdelim]skjsongtdelim (Get your defined delimiter)

Types
* JSON
* JSON-WEBHOOK
* JSON-ENUM ( WEBREQUEST METHODS )

Changers
* JSON-ARRAY
* JSON-OBJECT


Resolved Issues.
* #69
* #65
* #64
* #63
* #62
* #61
* #60
* #59
* #58
* #45
* #41
* #39
* #38

Special thanks...
I would like to thank everyone who participated in testing and trying out all sorts of features, and especially I would like to thank those who reported all the bugs!

Thank again! (@MinecraftNight4, @yhdev7935, @ExCorde, @Nocky, @welormit, @Envizar, @RedstoneGamer54)



What's Changed
* Update main from 2.8.6 to 2.9 by @SkJsonTeam in https://github.com/SkJsonTeam/skJson/pull/70


Full Changelog: https://github.com/SkJsonTeam/skJson/compare/2.8.6...2.9
SkJson 2.9

It's finally here, we have finally seen a fully stable version of SkJson, i.e. version 2.9 which introduced SkJson in the biggest steam, A lot of changes have been made from the ground up.

We have created our own documentation page for SkJson, on this page we will be able to post thready where you can share your code Snippets, we also have documentation for both versions with examples. The documentation is automatically updated! Let's get started on the changes!

More here!
SkJson 2.8.6
Fixed several issue with Paper/Purpur and skript 2.7.0 beta.
Fixed nulls elements by (SET/ADD) new element to JsonArray/JsonObject
Add loading json files from folder to the cache
https://github.com/SkJsonTeam/skJson/releases/tag/2.8.6
SkJson 2.8.5
[h4]Fixed java issue and file writing[/h4]
[h3]Minecraft support:[/h3]
- 1.13 - 1.16.5,
- 1.16.5-1.20

[h3]Skript version: [/h3]
- 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.
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:
(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:
set {_yaml json} to json from yaml file "..../test.yaml"[/B][/B]
[B][B]

  1. more properties of request's responses
Code:
[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


234695158-7d0bab15-a395-423b-8814-bd902d81f722.png


234694940-f43c9192-a25f-40d3-a277-935ca3bf0edb.png


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.


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
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

upload_2023-3-26_11-4-43.png


Thanks CoffeeRequired!
skJson 2.7.0⚠️
Introduce


Hello everyone.

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


[h3]Example[/h3]
Code:
{
  "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:
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
skJson pre-release 2.7.0⚠️
Introduce

> Hello everyone.

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


[h3]Example[/h3]
Code:
{
  "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