Code Monkey home page Code Monkey logo

skjson's Introduction

GitHub release GitHub issues GitHub closed issues GitHub All Downloads Discord License CodeFactor Java CI with Maven


SkJson

SkJson SkJson

The modern way how to handle JSON in the Skript

The addon uses GSON (Google JSON) for work with JSON in Skript

📑 Requirements

  • Java 17+
  • Minecraft 1.16.5+
  • Skript 2.8.0 +

🔑 Recommended

🆘 Where can I get help?

💡 How can I start with SkJson?

All tutorials are based on the latest version 2.9

for the first time and recommend working with SkJson Documentation

🗝️ Create json object/array from sources.

on script load:
  # From String
  # We can use escape sequences so two double quotes, or we can use single quote
  # Or we can define only KEYS without any quotes
  set {_json} to json from text "{""A"": false}"
  set {_json} to json from text "{'A': false}"
  set {_json} to json from text "{A: false}"
  
  # From file (json/yaml)
  # YAML: you can your old yaml file and SkJson will convert that to JSON file
  set {_json} to json from json file "plugins/SkJson/Files/test.json"
  set {_json} to json from yaml file "plugins/SkJson/Files/test.yaml"
  
  # From website
  # That will work only for GET! If you want to use other methods you should use requests
  set {_json} to json from website "https://dummyjson.com/products/1"
  
  # From any Skript/Bukkit object
  set {_json} to json from location(10, 20, 30, world("world"))

This depends on what you want to do in SkJson, if you just want to work with JSON you can just use Map/From but if you want for example Request's or work with files we have a small guide here.

🗝️ Example for requests.

Suppose we have some API and we want to use Skript to work with that API and get JSON responses from that API (server), SkJson offers Request's according to its own.

on script load:
	async make POST request to "https://dummyjson.com/carts/add":
		header: "Content-Type: application/json"
		content: json from text "{userId: 1, products: [{id: 1, quantity: 1}, {id: 50, quantity: 2}]}"
		save incorrect response: true
		lenient: true
		save:
			content: {-content}
			headers: {-header}
			status code: {-code}
			url: {-url}
command response:
	trigger:
		send {-content} with pretty print

What does mean lenient ? lenient means attempting to repair corrupted JSON from a server response. (thanks to @mnight4)

🗝️ Example for handling JSON file /wo cache.

SkJson can work with files whether it is writing, editing or appending. See also Write, New, Edit

# here we will create a new file
options:
    file_path: "plugins/SkJson/jsons/test.json"

on script load:
    new json file {@file_path} if json file {@file_path} does not exist
    
    # here we will work with the json file
    
    set {_json} to json from file {@file_path}
    
    # writing to file
    set {_data} to json from location(10, 20, 30, world("world"))
    write {_data} to json file {@file_path}
    
    # editing directly file
    edit value "world" of json file {@file_path} to "New World"
    
    # editing file with step over
    
    # getting the json file as Json object
    set {_json} to json from file {@file_path}
    set value of json object "world" in {_json} to "New World(By rewrote)"
    
    # write file back to JSON
    write {_json} to json file {@file_path}

🗝️ Example for handling JSON file /w cache.

What is cache? Cache is known for storing JSON in memory instead of SkJson having to open and close the file it puts its reference in memory, and you are working with memory all the time and if you would like to save the file from memory to a real file. you can do it at any time with save <json-id>

Check out this documentation.: Write, New, Edit, Link File, Save File, Unlink File, Get Cached JSON

options:
    file_path: "plugins/SkJson/jsons/test.json"

on script load:
    # here we will create a new file
    new json file {@file_path} if json file {@file_path} does not exist
    # here we will linked our file to our memory.
    link json file {@file_path} as "your_specified_value" if json file {@file_path} exists
    
    # here we will set value to memory reference of your file.
    set value of json objct "location" in (json "your_specified_value") to location(10, 20, 30, world("world"))
    
    # here we will get location of memory
    set {_location} to value "location" of (json "your_specified_value")
    # that will return {"==":"org.bukkit.Location","yaw":0.0,"world":"world","x":10.0,"y":20.0,"z":30.0,"pitch":0.0}
    
    # here we will save memory reference back to file
    save json "your_specified_value"

🗝️ Now we'll look at is how SkJson works with Skript/Bukkit objects

# let's say we have a command test and we work with Player Location. 
command test:
  trigger:
    set {_json_location} to json from location of player
    teleport player to {_json_location}
    # that will teleport player to location converted from JSON object to location
    
    set {_item} to diamond sword named "Test"
    set lore of {_item} to "&6Gold" and "&7Silver"
    enchant {_item} with Sharpness 5
    set {_json_item} to json from {_item}
    
    give {_json_item} to player

So conclusion, if the Json object contains the correct object key Skript/SkJson will try to parse the JSON as a real object.


skjson's People

Contributors

cooffeerequired avatar notsodelayed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skjson's Issues

Issue with changing multiple values with nested values

Issues when trying to change multiple values with nested values

function addPlayerData(p: offlineplayer):
    set {_json} to new json from file "plugins/skript/data/base.json"
    #firstJoin is the nested value
    change {_json} values "uuid", "firstJoin" to ({_p}'s uuid), unix timestamp of now

"uuid" will get set to the unix timestamp

A random error

[16:43:00 WARN]: [Skript] Plugin Skript v2.6.4 generated an exception while executing task 103
ch.njol.skript.SkriptAPIException: Serializer of number must override newInstance(), canBeInstantiated() or mustSyncDeserialization() if its class does not have a nullary constructor
at ch.njol.skript.classes.Serializer.newInstance(Serializer.java:79) ~[Skript-2.6.4.jar:?]
at ch.njol.yggdrasil.Yggdrasil.newInstance(Yggdrasil.java:335) ~[Skript-2.6.4.jar:?]
at ch.njol.yggdrasil.Yggdrasil.isSerializable(Yggdrasil.java:154) ~[Skript-2.6.4.jar:?]
at ch.njol.yggdrasil.YggdrasilOutputStream.writeGenericObject(YggdrasilOutputStream.java:173) ~[Skript-2.6.4.jar:?]
at ch.njol.yggdrasil.YggdrasilOutputStream.writeObject(YggdrasilOutputStream.java:249) ~[Skript-2.6.4.jar:?]
at ch.njol.skript.registrations.Classes.serialize(Classes.java:724) ~[Skript-2.6.4.jar:?]
at ch.njol.skript.variables.FlatFileStorage.save(FlatFileStorage.java:438) ~[Skript-2.6.4.jar:?]
at ch.njol.skript.variables.FlatFileStorage.save(FlatFileStorage.java:432) ~[Skript-2.6.4.jar:?]
at ch.njol.skript.variables.FlatFileStorage.saveVariables(FlatFileStorage.java:386) ~[Skript-2.6.4.jar:?]
at ch.njol.skript.variables.FlatFileStorage$1.run(FlatFileStorage.java:198) ~[Skript-2.6.4.jar:?]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Paper-411]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[patched_1.17.1.jar:git-Paper-411]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.17.1.jar:git-Paper-411]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

Item Conversion in JSON

Is your feature request related to a problem? Please describe.
When converting an item variable into JSON, all you get is useless information.

Describe the solution you'd like
I think it would be a great if skJson supported converting items to and from JSON.

Describe alternatives you've considered
There are ways to store different parts of an item with the ID and NBT data, but native support for this would be nice for things such as inventory storage and other use cases.

Additional Context
The current result you get from skJson looks like this:

{
   "types": [
    {
      "isAnything": false,
      "itemForm": false,
      "isAlias": false,
      "plain": false,
      "itemFlags": 2
    }
  ],
  "all": false,
  "amount": -1
}

null as new Data

Describe the bug
when creating a file or append function etc. Or in any function that expected input data, you got instead of Data (null)

Example...

To Reproduce
Steps to reproduce the behavior:

        # Creating the json file and set it to variable
        new json file "..."
        set {_jsonfile} to json from file "..."

        # Working with data -> appending/add/remove/get etc...
        set {_data} to 10
        append {_data} as nested object "nested:a:list[]" to {_jsonfile}
        write {_jsonfile} to json file "..."
  1. Run this example on version 2.6.0.
  2. See error

Expected behavior
Puts the data back into the file, not null.

Screenshots
image

Desktop

  • OS: Win 11
  • Version 2.6.0

Check if file is exist

Suggestion

It would be nice to add the ability to check if the file exists

Why?

To save servers RAM, it would be more efficient to distribute information about a large number of objects (for example, players) into several files. if each player contains 100 lines of information, and there will be several hundred of them, it would be better to save their data to different files and load as needed , but for this you first need to determine if the file with information about the player exists or not yet

Other

I really miss a function to check if a file exists, to see if it can be read or not

Nested keys are broken.

Skript-version: 2.7.0, 2.6.4
SkJson-version: 2.7.0-B, 2.8.0, 2.8.0-b1, 2.8.0-b2

Replication

[:async] change (:value|:key) %string% of (%jsonfile/string%|(:json file) %string%) to %objects%
https://skripthub.net/docs/?id=8944

set {_json} to json-object
set {_path} to "path-to-file.json"

change value "nested-keys" of jsonfile({_path}) to "..."

actually return a repeating itself.

The simply fix is something like that, creating object each by each
image
Thank to understood Coffee.
fix.zip

Unterminated Object ($.writable_letter.itemdata.meta.custom-model-data)

Describe the bug
Error when loading item nbt data with custom model data into a variable.

To Reproduce

Code:

on load:
    set {_jsonfile} to json from file "[LocalData]/[ServerData]/Mail/writable_letter.json"
    set {_item} to element "writable_letter:itemdata" of {_jsonfile}
    set {_a} to paper
    register new shaped recipe for {_item} using air, air, air, {_a}, {_a}, {_a}, {_a}, {_a}, {_a} with id "addonmanager:writable_letter"

JSON-File:

{
  "writable_letter": {
    "itemdata": {
      "==": "org.bukkit.inventory.ItemStack",
      "v": 3218,
      "type": "WRITABLE_BOOK",
      "meta": {
        "==": "ItemMeta",
        "meta-type": "BOOK",
        "display-name": "{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Briefpapier\"}],\"text\":\"\"}",
        "custom-model-data": 1
        "pages": [
          "Empfänger:\nNUTZE DIESE ZEILE\n\nZieladresse:  \nNUTZE DIESE ZEILE\n\nSender: \nNUTZE DIESE ZEILE\n\nTitel: \nNUTZE DIESE ZEILE"
        ]
      }
    }
  }
}

Error:

[16:35:57 WARN]: [skJson] §eWARNING§r ext.google.gson.stream.MalformedJsonException: Unterminated object at line 12 column 4 path $.writable_letter.itemdata.meta.custom-model-data
[16:35:57 INFO]: [SkBee] [Recipe] Error registering crafting recipe - result is null
[16:35:57 INFO]: [SkBee] [Recipe] Current Item: Register new shaped recipe for {_item} (<none>, as ch.njol.skript.aliases.ItemType) using ([[itemtype:air]], [[itemtype:air]], [[itemtype:air]], {_a} (piece of paper, as java.lang.Object), {_a} (piece of paper, as java.lang.Object), {_a} (piece of paper, as java.lang.Object), {_a} (piece of paper, as java.lang.Object), {_a} (piece of paper, as java.lang.Object) and {_a} (piece of paper, as java.lang.Object))[class java.lang.Object] with id '"addonmanager:writable_letter"'
[16:35:57 INFO]: [Skript] Successfully reloaded MAIL.sk. (99ms)

Expected behavior
The Item-Data should be loaded correctly.

Java 8 support!

Is your feature request related to a problem? Please describe.
Alot of servers use java 8, and it would be super cool if you made a version, or just added support for it. Some features might not work, but if the "main" part still works it would be cool!

Describe the solution you'd like
java 8 support :D

Describe alternatives you've considered
Nothing

Additional context
Nope

ItemStack enchants, meta broken

[19:35:22 WARN]: java.lang.NullPointerException: Cannot invoke "shaded.google.gson.JsonObject.entrySet()" because the return value of "shaded.google.gson.JsonObject.getAsJsonObject(String)" is null
[19:35:22 WARN]:        at skJson(2).jar//cz.coffee.core.adapters.Adapters$5.setEnchants(Adapters.java:178)
[19:35:22 WARN]:        at skJson(2).jar//cz.coffee.core.adapters.Adapters$5.fromJson(Adapters.java:225)
[19:35:22 WARN]:        at skJson(2).jar//cz.coffee.core.adapters.Adapters$5.fromJson(Adapters.java:173)
[19:35:22 WARN]:        at skJson(2).jar//cz.coffee.core.adapters.Adapters$7.lambda$fromJson$0(Adapters.java:582)
[19:35:22 WARN]:        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
[19:35:22 WARN]:        at skJson(2).jar//cz.coffee.core.adapters.Adapters$7.fromJson(Adapters.java:577)
[19:35:22 WARN]:        at skJson(2).jar//cz.coffee.core.adapters.Adapters$7.fromJson(Adapters.java:552)
[19:35:22 WARN]:        at skJson(2).jar//cz.coffee.core.utils.AdapterUtils.assignFrom(AdapterUtils.java:164)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//org.skriptlang.skript.lang.converter.Converters.convert(Converters.java:389)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.lang.Variable.getConverted(Variable.java:488)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.lang.Variable.getSingle(Variable.java:697)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.effects.EffOpenInventory.execute(EffOpenInventory.java:106)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.lang.Effect.run(Effect.java:50)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:62)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:90)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:52)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:312)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.command.ScriptCommand.lambda$execute$0(ScriptCommand.java:277)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:282)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.command.Commands.handleCommand(Commands.java:193)
[19:35:22 WARN]:        at Skript-2.7.0-beta1.jar//ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:152)
[19:35:22 WARN]:        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40)
[19:35:22 WARN]:        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76)
[19:35:22 WARN]:        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[19:35:22 WARN]:        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
[19:35:22 WARN]:        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126)
[19:35:22 WARN]:        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615)
[19:35:22 WARN]:        at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:2347)
[19:35:22 WARN]:        at net.minecraft.server.network.PlayerConnection.lambda$handleChatCommand$21(PlayerConnection.java:2331)
[19:35:22 WARN]:        at net.minecraft.util.thread.IAsyncTaskHandler.b(IAsyncTaskHandler.java:59)
[19:35:22 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
[19:35:22 WARN]:        at net.minecraft.server.TickTask.run(TickTask.java:18)
[19:35:22 WARN]:        at net.minecraft.util.thread.IAsyncTaskHandler.d(IAsyncTaskHandler.java:153)
[19:35:22 WARN]:        at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(IAsyncTaskHandlerReentrant.java:24)
[19:35:22 WARN]:        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1366)
[19:35:22 WARN]:        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197)
[19:35:22 WARN]:        at net.minecraft.util.thread.IAsyncTaskHandler.x(IAsyncTaskHandler.java:126)
[19:35:22 WARN]:        at net.minecraft.server.MinecraftServer.bi(MinecraftServer.java:1343)
[19:35:22 WARN]:        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1336)
[19:35:22 WARN]:        at net.minecraft.util.thread.IAsyncTaskHandler.c(IAsyncTaskHandler.java:136)
[19:35:22 WARN]:        at net.minecraft.server.MinecraftServer.i_(MinecraftServer.java:1314)
[19:35:22 WARN]:        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1202)
[19:35:22 WARN]:        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:322)
[19:35:22 WARN]:        at java.base/java.lang.Thread.run(Thread.java:833)

Mapping json

Appears maping json is broken. I've done a little testing and I believe its due to the "LazilyParsedNumber" not working with variables or something. CODE:

on join:
	Load(player)
	if json file "plugins/Skript/Json/%player's uuid%.json" does not exists:
		new json file "plugins/Skript/Json/%player's uuid%.json"
on quit:
	Save(player, true)
every 3 minutes:
	loop all players:
		Save(loop-player)
		wait a second
	
	
function Save(p: player, b: boolean=false):
	set {_json} to {PlayerData::%{_p}'s uuid%::*}'s form
	write {_json} to json file "plugins/Skript/Json/%{_p}'s uuid%.json"
	if {_b} = true:/
		delete {PlayerData::%{_p}'s uuid%::*}
function Load(p: player):
	set {_json} to json from file "plugins/Skript/Json/%{_p}'s uuid%.json"
	map {_json} to {_a::*}
	loop indexes of {_a::*}:
		if {_a::%loop-value%} is set:
			set {PlayerData::%{_p}'s uuid%::%loop-value%} to "%{_a::%loop-value%}%"
			broadcast "%loop-value% | %{_a::%loop-value%}%"
		broadcast "%loop-value% | %{_a::%loop-value%}% %class of {_a::%loop-value%}%"
	broadcast "A::*"```
	
(mapping to a non-local variable immediately breaks everything)
	

Issue with the map function D:

When I use the map json funcion, in-game nothing appears.
but in the console it directly explodes with this message.

image

image

image

if it is so long that it required like 3 screenshots

In the errors it says that the problem is using reqn but I know that the problem is from the gson script because it only happens when I update it to its latest version, it worked moderately correctly in version 1.1.0.

I had to update it because the json mapping function works strangely in certain cases instead of returning the value it should, it returned a true, and I wanted to see if it was working in the new version.


Minecraft version: 1.19.2

Server software: purpur

Skript version: 2.6.4

Skript gson version: 1.4.0

mapped json values not interpretated as strings

I'm trying to adapt my skript (was already working using an old json interpreter), but I'm having problems in the interpretation of the values for the mapped json, because is not being outputted as strings and instead is saved as json-object (I think).

I would like to know if there's something I’m missing on the conversion or if this could be an improvement on the addon for handling values in the json deserialization.

Example of problem:

Json

{
    "10-31":{
       "lore":[
          "&4Recompensas extras!",
          "&fObtendrás items y más dinero por ser",
          "&f <##eb6123>Halloween&f!"
       ],
       ...
}

Code

map json from {@example_json} to {variable::*}
set {_lore::*} to {variable::10-31::lore::*}
add "" to {_lore::*}
add "&8&l > &8Recompensa perdida" to {_lore::*}
message {_lore::*} to console

Output

[14:03:00 INFO]: "Recompensas extras!"
[14:03:00 INFO]: "Obtendrás items y más dinero por ser"
[14:03:00 INFO]: " Halloween!"
[14:03:00 INFO]:
[14:03:00 INFO]:  > Recompensa perdida

Expected

[14:03:00 INFO]: Recompensas extras!
[14:03:00 INFO]: Obtendrás items y más dinero por ser
[14:03:00 INFO]:  Halloween!
[14:03:00 INFO]:
[14:03:00 INFO]:  > Recompensa perdida

As you can see, the first 3 results are outputted as something else on the console, and can't be interpreted by skript as strings, so I can't use them on an item lore like I need in this case.

I also tried using something like:
set {_lore::*} to {variable::10-31::lore::*} as strings
but it doesn't work.
Probably it could be fixed with a loop function, but it wouldn't be ideal in my case.

[Suggestion] Json-Watcher event

It would be useful in some occasions to have a trigger when a Json-Watcher executes a save.
For example:

on json-watcher saves:
	broadcast event-json -> This one have the full saved-json
	broadcast event-link -> This is the Link ID

Removing Entries from JSON-Lists (Counterpart of Appending)

    "permissions": {
      "members_allowed_to_build": [
        "933334f8-a330-4551-81dd-aafb677a8186"
      ]
    },

Effect that makes it possible, to remove entries of json-maps.
At the moment, this is only possible via mapping.
Removing json values (strings etc.) is possible already.

Bug with Item-Data (Writable Book)

Describe the bug
Massive Error with this code:

To Reproduce

On rightclick with writable book:
    set {_json} to json from event-item
    broadcast {_json} with pretty print
    give player {_json}

Expected behavior
The Book which was saved should be given to the player.

Error-Message

[12:15:33 ERROR]: [org.bukkit.configuration.serialization.ConfigurationSerialization] Could not call method 'public static org.bukkit.inventory.meta.ItemMeta org.bukkit.craftbukkit.v1_19_R2.inventory.CraftMetaItem$SerializableMeta.deserialize(java.util.Map) throws java.lang.Throwable' of class org.bukkit.craftbukkit.v1_19_R2.inventory.CraftMetaItem$SerializableMeta for deserialization
java.lang.IllegalArgumentException: custom-model-data(1.0) is not a valid class java.lang.Integer
        at org.bukkit.craftbukkit.v1_19_R2.inventory.CraftMetaItem$SerializableMeta.getObject(CraftMetaItem.java:237) ~[paper-1.19.3.jar:git-Paper-365]
        at org.bukkit.craftbukkit.v1_19_R2.inventory.CraftMetaItem.<init>(CraftMetaItem.java:529) ~[paper-1.19.3.jar:git-Paper-365]
        at org.bukkit.craftbukkit.v1_19_R2.inventory.CraftMetaBook.<init>(CraftMetaBook.java:129) ~[paper-1.19.3.jar:git-Paper-365]
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
        at org.bukkit.craftbukkit.v1_19_R2.inventory.CraftMetaItem$SerializableMeta.deserialize(CraftMetaItem.java:201) ~[paper-1.19.3.jar:git-Paper-365]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeViaMethod(ConfigurationSerialization.java:85) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.serialization.ConfigurationSerialization.deserialize(ConfigurationSerialization.java:127) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(ConfigurationSerialization.java:207) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at cz.coffee.adapter.DefaultAdapters$TypeAdapter$Bukkit.deserialize(DefaultAdapters.java:789) ~[SkJson-2.6.21.jar:?]
        at cz.coffee.adapter.DefaultAdapters$TypeAdapter$Bukkit.deserialize(DefaultAdapters.java:783) ~[SkJson-2.6.21.jar:?]
        at cz.coffee.adapter.DefaultAdapters$TypeAdapter$Bukkit.deserialize(DefaultAdapters.java:766) ~[SkJson-2.6.21.jar:?]
        at ext.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76) ~[SkJson-2.6.21.jar:?]
        at ext.google.gson.Gson.fromJson(Gson.java:1227) ~[SkJson-2.6.21.jar:?]
        at ext.google.gson.Gson.fromJson(Gson.java:1329) ~[SkJson-2.6.21.jar:?]
        at ext.google.gson.Gson.fromJson(Gson.java:1271) ~[SkJson-2.6.21.jar:?]
        at cz.coffee.adapter.DefaultAdapters$3.fromJson(DefaultAdapters.java:436) ~[SkJson-2.6.21.jar:?]
        at cz.coffee.adapter.DefaultAdapters$3.fromJson(DefaultAdapters.java:148) ~[SkJson-2.6.21.jar:?]
        at cz.coffee.adapter.DefaultAdapters.assignFrom(DefaultAdapters.java:686) ~[SkJson-2.6.21.jar:?]
        at ch.njol.skript.classes.ChainedConverter.convert(ChainedConverter.java:55) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.registrations.Converters.convert(Converters.java:160) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.lang.Variable.getConverted(Variable.java:458) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.lang.Variable.getAll(Variable.java:680) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.lang.Variable.getArray(Variable.java:672) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.effects.EffChange.execute(EffChange.java:274) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.lang.Effect.run(Effect.java:50) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.lang.Trigger.execute(Trigger.java:56) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:142) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.SkriptEventHandler.access$000(SkriptEventHandler.java:53) ~[Skript-2.6.4.jar:?]
        at ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:71) ~[Skript-2.6.4.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:git-Paper-365]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:672) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:546) ~[paper-1.19.3.jar:git-Paper-365]
        at org.bukkit.craftbukkit.v1_19_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:503) ~[paper-1.19.3.jar:git-Paper-365]
        at org.bukkit.craftbukkit.v1_19_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:498) ~[paper-1.19.3.jar:git-Paper-365]
        at org.bukkit.craftbukkit.v1_19_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:493) ~[paper-1.19.3.jar:git-Paper-365]
        at org.bukkit.craftbukkit.v1_19_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:489) ~[paper-1.19.3.jar:git-Paper-365]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItem(ServerGamePacketListenerImpl.java:2017) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundUseItemPacket.handle(ServerboundUseItemPacket.java:32) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundUseItemPacket.a(ServerboundUseItemPacket.java:8) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:51) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.19.3.jar:git-Paper-365]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1341) ~[paper-1.19.3.jar:git-Paper-365]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[paper-1.19.3.jar:git-Paper-365]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1318) ~[paper-1.19.3.jar:git-Paper-365]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1311) ~[paper-1.19.3.jar:git-Paper-365]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1289) ~[paper-1.19.3.jar:git-Paper-365]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1177) ~[paper-1.19.3.jar:git-Paper-365]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.19.3.jar:git-Paper-365]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Number String breaks the addon

on load:
	set {_json} to json from string "{'data_1': 'output_1'}"
	send "BUILD 1:" to console
	send {_json} with pretty print to console
	#
	set {_string} to "32458967213421348712348"
	append "output" with key "arg-1" as nested object "%{_string}%" to {_json}
	send "BUILD 2:" to console
	send {_json} with pretty print to console

When a string only contains NUMBERS, it is converted to an INTEGER. Apparently this causes an error when trying to use it on KEYS or NESTED OBJECTS.

Adding RE-APPENDING Syntax

Is your feature request related to a problem? Please describe.
Removing entries from json files requires more complicated syntax then appending.

Describe the solution you'd like
A syntax called "reappending" would make it easier to handle files and json formats. It does the same like the appending syntax,
but removes instead of adds.

Additional context
(https://skripthub.net/docs/?id=8489)

Conflicting erros

write {_json} to json file "plugins/Skript/jsonplayerdata/%{_p}'s uuid%"
When without ".json" yeets error:
java.lang.IllegalArgumentException: File must end with '.json'
at cz.coffee.core.utils.JsonFile.(JsonFile.java:15) ~[skJson-2.8.5.jar:?]
at cz.coffee.skript.effects.EffWriteJsonFile.execute(EffWriteJsonFile.java:54) ~[skJson-2.8.5.jar:?]
at ch.njol.skript.util.AsyncEffect.lambda$walk$1(AsyncEffect.java:60) ~[Skript-2.6.4.jar:?]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Paper-411]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[patched_1.17.1.jar:git-Paper-411]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.17.1.jar:git-Paper-411]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
[09:20:39] [Craft Scheduler Thread - 17 - Skript/WARN]: [Skript] Plugin Skript v2.6.4 generated an exception while executing task 27858
java.lang.IllegalArgumentException: File must end with '.json'
at cz.coffee.core.utils.JsonFile.(JsonFile.java:15) ~[skJson-2.8.5.jar:?]
at cz.coffee.skript.effects.EffWriteJsonFile.execute(EffWriteJsonFile.java:54) ~[skJson-2.8.5.jar:?]
at ch.njol.skript.util.AsyncEffect.lambda$walk$1(AsyncEffect.java:60) ~[Skript-2.6.4.jar:?]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Paper-411]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[patched_1.17.1.jar:git-Paper-411]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.17.1.jar:git-Paper-411]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
[09:20:39] [Craft Scheduler Thread - 16 - Skript/WARN]: [Skript] Plugin Skript v2.6.4 generated an exception while executing task 27857
java.lang.IllegalArgumentException: File must end with '.json'
at cz.coffee.core.utils.JsonFile.(JsonFile.java:15) ~[skJson-2.8.5.jar:?]
at cz.coffee.skript.effects.EffWriteJsonFile.execute(EffWriteJsonFile.java:54) ~[skJson-2.8.5.jar:?]
at ch.njol.skript.util.AsyncEffect.lambda$walk$1(AsyncEffect.java:60) ~[Skript-2.6.4.jar:?]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Paper-411]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[patched_1.17.1.jar:git-Paper-411]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.17.1.jar:git-Paper-411]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

And when I add .json to everything this line:
map {_json} to {playerdata::%{_p}'s uuid%::*}
gives this error:
[06:00:56] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[06:00:56] [Server thread/ERROR]: #!#!
[06:00:56] [Server thread/ERROR]: #!#! Something went horribly wrong with Skript.
[06:00:56] [Server thread/ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[06:00:56] [Server thread/ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[06:00:56] [Server thread/ERROR]: #!#! Here is full list of them:
[06:00:56] [Server thread/ERROR]: #!#! skJson v2.8.5 (https://github.com/SkJsonTeam/skJson) skript-reflect v2.3 (https://github.com/TPGamesNL/skript-reflect) skript-gui v1.3 (https://github.com/APickledWalrus/skript-gui) DiSky v4.11.1 SkBee v2.11.0 (https://github.com/ShaneBeee/SkBee)
[06:00:56] [Server thread/ERROR]: #!#! We could not identify which of those are specially related, so this might also be Skript issue.
[06:00:56] [Server thread/ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[06:00:56] [Server thread/ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[06:00:56] [Server thread/ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[06:00:56] [Server thread/ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[06:00:56] [Server thread/ERROR]: #!#! Only if the author tells you to do so, report it to Skript's issue tracker.
[06:00:56] [Server thread/ERROR]: #!#!
[06:00:56] [Server thread/ERROR]: #!#! Stack trace:
[06:00:56] [Server thread/ERROR]: #!#! java.lang.IllegalArgumentException: Event may not be null in non-simple VariableStrings!
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.VariableString.toString(VariableString.java:365)
[06:00:56] [Server thread/ERROR]: #!#! at skJson-2.8.5.jar//cz.coffee.skript.mapping.EffJsonToSkriptList.toString(EffJsonToSkriptList.java:52)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.Skript.exception(Skript.java:1737)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.Skript.exception(Skript.java:1560)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:100)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:56)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.function.ScriptFunction.execute(ScriptFunction.java:85)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.function.Function.execute(Function.java:129)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.function.FunctionReference.execute(FunctionReference.java:299)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.function.EffFunctionCall.execute(EffFunctionCall.java:52)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.Effect.run(Effect.java:50)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:56)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:142)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.SkriptEventHandler.access$000(SkriptEventHandler.java:53)
[06:00:56] [Server thread/ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:71)
[06:00:56] [Server thread/ERROR]: #!#! at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80)
[06:00:56] [Server thread/ERROR]: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[06:00:56] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628)
[06:00:56] [Server thread/ERROR]: #!#! at net.minecraft.server.players.PlayerList.postChunkLoadJoin(PlayerList.java:360)
[06:00:56] [Server thread/ERROR]: #!#! at net.minecraft.server.players.PlayerList.lambda$placeNewPlayer$1(PlayerList.java:302)
[06:00:56] [Server thread/ERROR]: #!#! at net.minecraft.server.network.PlayerConnection.tick(PlayerConnection.java:307)
[06:00:56] [Server thread/ERROR]: #!#! at net.minecraft.network.NetworkManager.a(NetworkManager.java:555)
[06:00:56] [Server thread/ERROR]: #!#! at net.minecraft.server.network.ServerConnection.c(ServerConnection.java:201)
[06:00:56] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1656)
[06:00:56] [Server thread/ERROR]: #!#! at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:490)
[06:00:56] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1483)
[06:00:56] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1282)
[06:00:56] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319)
[06:00:56] [Server thread/ERROR]: #!#! at java.base/java.lang.Thread.run(Thread.java:833)
[06:00:56] [Server thread/ERROR]: #!#!
[06:00:56] [Server thread/ERROR]: #!#! Version Information:
[06:00:56] [Server thread/ERROR]: #!#! Skript: 2.6.4
[06:00:56] [Server thread/ERROR]: #!#! Flavor: skriptlang-github
[06:00:56] [Server thread/ERROR]: #!#! Date: 17:14:25.041218900
[06:00:56] [Server thread/ERROR]: #!#! Bukkit: 1.17.1-R0.1-SNAPSHOT
[06:00:56] [Server thread/ERROR]: #!#! Minecraft: 1.17.1
[06:00:56] [Server thread/ERROR]: #!#! Java: 17.0.7 (OpenJDK 64-Bit Server VM 17.0.7+7)
[06:00:56] [Server thread/ERROR]: #!#! OS: Linux amd64 5.19.0-43-generic
[06:00:56] [Server thread/ERROR]: #!#!
[06:00:56] [Server thread/ERROR]: #!#! Server platform: Paper
[06:00:56] [Server thread/ERROR]: #!#!
[06:00:56] [Server thread/ERROR]: #!#! Current node: null
[06:00:56] [Server thread/ERROR]: #!#! Current item: Load(the player)
[06:00:56] [Server thread/ERROR]: #!#! Current trigger: join (simple event) (jsonplayerdata.sk, line 1)
[06:00:56] [Server thread/ERROR]: #!#!
[06:00:56] [Server thread/ERROR]: #!#! Thread: Server thread
[06:00:56] [Server thread/ERROR]: #!#!
[06:00:56] [Server thread/ERROR]: #!#! Language: english
[06:00:56] [Server thread/ERROR]: #!#! Link parse mode: STRICT
[06:00:56] [Server thread/ERROR]: #!#!
[06:00:56] [Server thread/ERROR]: #!#! End of Error.
[06:00:56] [Server thread/ERROR]: #!#!

Loop-entries to find an array (Gives console error)

Beforehand, I'd set a list to the elements of an entry, that'd give me a NullPointerException for every time that entry did not contain an array.

Instead of testing if the size of that list was set, or greater than 0, I'd use this:

                set {_uuid} to uuid of {_p}
                set {_json} to json from file "storage/players/%{_uuid}%.json"
                loop entries of {_json}:
                    delete {_0}
                    loop entries of (element "%loop-key%" of {_json}):
                        loop entries of loop-element-2:
                            set {_0} to true
                            send "&d%loop-key-1%:"
                            send "&3 %loop-key-3%: &b%loop-element-3%"
                            if arg-2 is "rff":
                                set {Data::%{_uuid}%::%loop-key-1%::%loop-key-3%} to loop-element-3
                    if {_0} is not set:
                        send "&d%loop-key%: &b%loop-element%"
                        if loop-key is not "playername" or "rank":
                            set {Data::%{_uuid}%::%loop-key%} to loop-element

That does output this error in console for every time, it loops through a entry that does not contain an array:

[skJson] ?cUnsupported input, use string or json either

Other than that, it works perfectly fine.
Skript Version: 2.6.4
SkJson Version: 2.8.6
Server Version: 1.20.1-R0.1-SNAPSHOT

Breaks skript-reflect and syntax issues

Paper 1.18.2 - Skript 2.6.4 - skript-gson 2.0.2 - skript-reflect 2.3

From everything I've tested so far, this addon works great. But, it does break some syntax and also causes skript-reflect to break. Here's an example:

image
image

I tried it without the gson addon and it works perfect. If I had gson, it throws that error. Another syntax it breaks is comparisons:
image
image

I really hope this gets fixed soon because I really need a reliable way to handle json and skript-reflect is also extremely important. Hopefully these can work together soon :)

Better Changer

Describe the bug
At this moment you can't set or add, remove from any json.

To Reproduce
Steps to reproduce the behavior:

set {_json} to json from string "{'A': [1,2,3]}"
add "A;10" to {_json}
send {_json}
```json
{"A": [1,2,3,10]}

But when you try add/remove to cached json it's stay unchanged.

SkJson v: 2.5

Future

set [json] value %string% of %json% to %object%
set [json] value %string% of %json% to cached json %string%

add [json] value %object% to %json%
add [json] value %object% to cached json %string%

remove [json] [value] %string% from %json%
remove [json] [value] %string% from cached json %string%

Path-Hotlinking

instead of:

append "test" as nested object "nested:a:list[]" to json file "[LocalData]/[ServerData]/Towns/%{_townname}%/towndefinition.json"

this:

hotlink json file "[LocalData]/[ServerData]/Towns/%{_townname}%/towndefinition.json" to "towndefinition"
append "test" as nested object "nested:a:list[]" to hotlinked json file "towndefinition"


When you have long paths your code is getting messy. This would fix it. 

Strange bug with colored pretty print

	trigger:
		set {_data} to json from "{}"
		set value of json object "2" in {_data} to json from "{'a': '1test', 'b': '2test', 'c': '3test'}"
		send {_data} with pretty print
		send {_data}

изображение

So... If string starts with digit, pretty print adds this

[Suggestion] Remove the * when mapping a json -> variables.

When mapping a json to variables, it always adds a * as the first element.

json:
{data:[{"msg": 1},{"msg": 2},{"msg": 3}]}

Skript Var:
{_temp::data::*} -> [Doesn't return data]
{_temp::data::1::msg} -> 1
{_temp::data::2::msg} -> 2
{_temp::data::3::msg} -> 3

JSON-Format is having problems with UTF-8 characters.

Describe the bug
When you use UTF-8 characters in saved strings in a json-file, the output is messy.

To Reproduce

      "textlines": [
        "&f",
        "               &f &f&lGute Fee:",
        "               &7Du möchtest eine Siedlung gründen? Nun gut.",
        "               &7Ich habe den Kaufvertrag für das Land unter",
        "               &7deinen Füßen mitgebracht. Klicke mit der",
        "               &7rechten Maustaste (RMB) auf mich!",
        " "
      ],

Expected behavior
The UTF-8 characters should be encoded correctly.

Screenshots
Unbenannt

Version$check shall stop plugin

Describe the bug
The Version$check shall stop enabling the plugin

To Reproduce
Steps to reproduce the behavior:

  1. Use pterodactyl hosting site
  2. run any version of minecraft with the new version of skript-gson
  3. See error

Expected behavior
Shall enable the server without a problem

Screenshots

Non-stored requests doesn't work

My code:

command testt:
  trigger:
    make GET request to "https://dummyjson.com/products/1":
      content: {_c}
    broadcast {_c}

Console error:

[19:35:00 ERROR]: #!#! [Skript] Severe Error:
[19:35:00 ERROR]: #!#!
[19:35:00 ERROR]: #!#! Something went horribly wrong with Skript.
[19:35:00 ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[19:35:00 ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[19:35:00 ERROR]: #!#! Here is full list of them:
[19:35:00 ERROR]: #!#! skript-placeholders v1.5.2 (https://github.com/APickledWalrus/skript-placeholders) skript-reflect v2.4-dev1 (https://github.com/TPGamesNL/skript-reflect) SkJson v2.9.4 (https://www.skjson.xyz/) SkBee v2.18.3 (https://github.com/ShaneBeee/SkBee) skUtilities v0.9.2 (https://tim740.github.io/) SkQuery v4.1.10
[19:35:00 ERROR]: #!#! We could not identify which of those are specially related, so this might also be Skript issue.
[19:35:00 ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[19:35:00 ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[19:35:00 ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[19:35:00 ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[19:35:00 ERROR]: #!#! Only if the author tells you to do so, report it to Skript's issue tracker.
[19:35:00 ERROR]: #!#!
[19:35:00 ERROR]: #!#! Stack trace:
[19:35:00 ERROR]: #!#! java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
[19:35:00 ERROR]: #!#!     at SkJson (2).jar//cz.coffee.skjson.skript.request.RequestUtil.validateContent(RequestUtil.java:107)
[19:35:00 ERROR]: #!#!     at SkJson (2).jar//cz.coffee.skjson.skript.request.SecCreateRequest.walk(SecCreateRequest.java:152)
[19:35:00 ERROR]: #!#!     at Skript (4).jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:90)
[19:35:00 ERROR]: #!#!     at Skript (4).jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:52)
[19:35:00 ERROR]: #!#!     at Skript (4).jar//ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:316)
[19:35:00 ERROR]: #!#!     at Skript (4).jar//ch.njol.skript.command.ScriptCommand.lambda$execute$0(ScriptCommand.java:275)
[19:35:00 ERROR]: #!#!     at Skript (4).jar//ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:286)
[19:35:00 ERROR]: #!#!     at Skript (4).jar//ch.njol.skript.command.ScriptCommand.onCommand(ScriptCommand.java:221)
[19:35:00 ERROR]: #!#!     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[19:35:00 ERROR]: #!#!     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168)
[19:35:00 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:1001)
[19:35:00 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_20_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64)
[19:35:00 ERROR]: #!#!     at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265)
[19:35:00 ERROR]: #!#!     at net.minecraft.commands.CommandDispatcher.performCommand(CommandDispatcher.java:332)
[19:35:00 ERROR]: #!#!     at net.minecraft.commands.CommandDispatcher.a(CommandDispatcher.java:316)
[19:35:00 ERROR]: #!#!     at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:2447)
[19:35:00 ERROR]: #!#!     at net.minecraft.server.network.PlayerConnection.lambda$handleChatCommand$22(PlayerConnection.java:2407)
[19:35:00 ERROR]: #!#!     at net.minecraft.util.thread.IAsyncTaskHandler.b(IAsyncTaskHandler.java:59)
[19:35:00 ERROR]: #!#!     at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
[19:35:00 ERROR]: #!#!     at net.minecraft.server.TickTask.run(TickTask.java:18)
[19:35:00 ERROR]: #!#!     at net.minecraft.util.thread.IAsyncTaskHandler.d(IAsyncTaskHandler.java:153)
[19:35:00 ERROR]: #!#!     at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(IAsyncTaskHandlerReentrant.java:24)
[19:35:00 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1365)
[19:35:00 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197)
[19:35:00 ERROR]: #!#!     at net.minecraft.util.thread.IAsyncTaskHandler.x(IAsyncTaskHandler.java:126)
[19:35:00 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.bg(MinecraftServer.java:1342)
[19:35:00 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1335)
[19:35:00 ERROR]: #!#!     at net.minecraft.util.thread.IAsyncTaskHandler.c(IAsyncTaskHandler.java:136)
[19:35:00 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.p_(MinecraftServer.java:1313)
[19:35:00 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1201)
[19:35:00 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:322)
[19:35:00 ERROR]: #!#!     at java.base/java.lang.Thread.run(Thread.java:833)
[19:35:00 ERROR]: #!#!
[19:35:00 ERROR]: #!#! Version Information:
[19:35:00 ERROR]: #!#!   Skript: 2.7.2 (latest)
[19:35:00 ERROR]: #!#!     Flavor: skriptlang-github
[19:35:00 ERROR]: #!#!     Date: 17:46:44.085781900
[19:35:00 ERROR]: #!#!   Bukkit: 1.20.1-R0.1-SNAPSHOT
[19:35:00 ERROR]: #!#!   Minecraft: 1.20.1
[19:35:00 ERROR]: #!#!   Java: 17.0.8 (Java HotSpot(TM) 64-Bit Server VM 17.0.8+9-LTS-211)
[19:35:00 ERROR]: #!#!   OS: Windows 11 amd64 10.0
[19:35:00 ERROR]: #!#!
[19:35:00 ERROR]: #!#! Server platform: Paper
[19:35:00 ERROR]: #!#!
[19:35:00 ERROR]: #!#! Current node: null
[19:35:00 ERROR]: #!#! Current item: New request section
[19:35:00 ERROR]: #!#! Current trigger: command /testt (simple event) (vote.sk, line 104)
[19:35:00 ERROR]: #!#!
[19:35:00 ERROR]: #!#! Thread: Server thread
[19:35:00 ERROR]: #!#!
[19:35:00 ERROR]: #!#! Language: english
[19:35:00 ERROR]: #!#! Link parse mode: DISABLED
[19:35:00 ERROR]: #!#!
[19:35:00 ERROR]: #!#! End of Error.
[19:35:00 ERROR]: #!#!

Error when getting item from json

skJson Version: 2.9
Skript Version: 2.7.0
Minecraft Version: Paper 1.20.1

When getting as item, for example,

"==": "org.bukkit.inventory.ItemStack",
"v": 3465,
"meta": {
  "==": "ItemMeta",
  "meta-type": "UNSPECIFIC",
  "Damage": 3
},
"type": "DIAMOND_SWORD"

, it gives this error:

[20:45:05 ERROR]: [org.bukkit.configuration.serialization.ConfigurationSerialization] Could not call method 'public static org.bukkit.inventory.meta.ItemMeta org.bukkit.craftbukkit.v1_20_R1.inventory.CraftMetaItem$SerializableMeta.deserialize(java.util.Map) throws java.lang.Throwable' of class org.bukkit.craftbukkit.v1_20_R1.inventory.CraftMetaItem$SerializableMeta for deserialization
java.lang.IllegalArgumentException: Damage(3.0) is not a valid class java.lang.Integer
        at org.bukkit.craftbukkit.v1_20_R1.inventory.CraftMetaItem$SerializableMeta.getObject(CraftMetaItem.java:240) ~[paper-1.20.1.jar:git-Paper-174]
        at org.bukkit.craftbukkit.v1_20_R1.inventory.CraftMetaItem.<init>(CraftMetaItem.java:577) ~[paper-1.20.1.jar:git-Paper-174]
        at jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67) ~[?:?]
        at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:483) ~[?:?]
        at org.bukkit.craftbukkit.v1_20_R1.inventory.CraftMetaItem$SerializableMeta.deserialize(CraftMetaItem.java:204) ~[paper-1.20.1.jar:git-Paper-174]
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:577) ~[?:?]
        at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeViaMethod(ConfigurationSerialization.java:85) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.serialization.ConfigurationSerialization.deserialize(ConfigurationSerialization.java:127) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(ConfigurationSerialization.java:207) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at cz.coffee.skjson.skript.base.Converter$BukkitConverter.deserialize(Converter.java:548) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.skjson.skript.base.Converter$BukkitConverter.deserialize(Converter.java:534) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.api.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.api.gson.Gson.fromJson(Gson.java:1227) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.api.gson.Gson.fromJson(Gson.java:1329) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.api.gson.Gson.fromJson(Gson.java:1271) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.skjson.skript.base.Converter$3.fromJson(Converter.java:403) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.skjson.skript.base.Converter$3.fromJson(Converter.java:114) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.skjson.skript.base.Converter$2.fromJson(Converter.java:99) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.skjson.skript.base.Converter$2.fromJson(Converter.java:62) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.skjson.parser.ParserUtil.from(ParserUtil.java:280) ~[skJson-2.9.shaded(2).jar:?]
        at cz.coffee.skjson.skript.base.JsonBase$Elements.get(JsonBase.java:335) ~[skJson-2.9.shaded(2).jar:?]
        at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:101) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.util.ConvertedExpression.getArray(ConvertedExpression.java:165) ~[Skript(3).jar:?]
        at ch.njol.skript.effects.EffChange.execute(EffChange.java:272) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.Effect.run(Effect.java:50) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:62) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:90) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.Trigger.execute(Trigger.java:52) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.function.ScriptFunction.execute(ScriptFunction.java:86) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.function.Function.execute(Function.java:129) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.function.FunctionReference.execute(FunctionReference.java:301) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.function.ExprFunctionCall.get(ExprFunctionCall.java:60) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:101) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.util.SimpleExpression.getSingle(SimpleExpression.java:59) ~[Skript(3).jar:?]
        at ch.njol.skript.effects.EffOpenInventory.execute(EffOpenInventory.java:106) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.Effect.run(Effect.java:50) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:62) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:90) ~[Skript(3).jar:?]
        at ch.njol.skript.lang.Trigger.execute(Trigger.java:52) ~[Skript(3).jar:?]
        at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:312) ~[Skript(3).jar:?]
        at ch.njol.skript.command.ScriptCommand.lambda$execute$0(ScriptCommand.java:277) ~[Skript(3).jar:?]
        at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:282) ~[Skript(3).jar:?]
        at ch.njol.skript.command.Commands.handleCommand(Commands.java:193) ~[Skript(3).jar:?]
        at ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:152) ~[Skript(3).jar:?]
        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:git-Paper-174]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.1.jar:git-Paper-174]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.1.jar:git-Paper-174]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2330) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$21(ServerGamePacketListenerImpl.java:2314) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.1.jar:git-Paper-174]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1338) ~[paper-1.20.1.jar:git-Paper-174]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[paper-1.20.1.jar:git-Paper-174]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1315) ~[paper-1.20.1.jar:git-Paper-174]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1308) ~[paper-1.20.1.jar:git-Paper-174]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1286) ~[paper-1.20.1.jar:git-Paper-174]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1174) ~[paper-1.20.1.jar:git-Paper-174]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.20.1.jar:git-Paper-174]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Damage is not displayed after that

[Suggestion]: Save invalid responses as nested json

In some webrequests, it is not always possible to get a response in valid json format.

For example, these may appear in another format or have part of the json malformed:

{\"message\":\"this json is broken},
This is just a string, nothing important...

I think in these situations, instead of destroying the response, it should be stored anyway, but inside a nested json, in case you want to use the response anyway:

["{\"message\":\"this json is broken},"]
["This is just a string, nothing important..."]

Error log for v1.1.3 (possible error in map function)

Hi,

I tried the latest version, and it works great! but I also get an error on the console when loading a skript.
When my skript loads I get this:

[20:18:46] [Server thread/WARN]: ch.njol.skript.SkriptAPIException: Serializer of number must override newInstance(), canBeInstantiated() or mustSyncDeserialization() if its class does not have a nullary constructor
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.classes.Serializer.newInstance(Serializer.java:79)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.yggdrasil.Yggdrasil.newInstance(Yggdrasil.java:335)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.yggdrasil.Yggdrasil.isSerializable(Yggdrasil.java:154)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.yggdrasil.YggdrasilOutputStream.writeGenericObject(YggdrasilOutputStream.java:173)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.yggdrasil.YggdrasilOutputStream.writeObject(YggdrasilOutputStream.java:249)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.registrations.Classes.serialize(Classes.java:724)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.variables.Variables.serialize(Variables.java:548)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.variables.Variables.serialize(Variables.java:542)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.variables.Variables.saveVariableChange(Variables.java:552)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.variables.Variables.setVariable(Variables.java:385)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.variables.Variables.setVariable(Variables.java:376)
[20:18:46] [Server thread/WARN]: 	at skript-gson-1.1.3.jar//cz.coffee.skriptgson.skript.effect.EffMapJsonToList.setVariable(EffMapJsonToList.java:131)
[20:18:46] [Server thread/WARN]: 	at skript-gson-1.1.3.jar//cz.coffee.skriptgson.skript.effect.EffMapJsonToList.map(EffMapJsonToList.java:124)
[20:18:46] [Server thread/WARN]: 	at skript-gson-1.1.3.jar//cz.coffee.skriptgson.skript.effect.EffMapJsonToList.lambda$JsonHandlerObject$0(EffMapJsonToList.java:94)
[20:18:46] [Server thread/WARN]: 	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
[20:18:46] [Server thread/WARN]: 	at skript-gson-1.1.3.jar//cz.coffee.skriptgson.skript.effect.EffMapJsonToList.JsonHandlerObject(EffMapJsonToList.java:94)
[20:18:46] [Server thread/WARN]: 	at skript-gson-1.1.3.jar//cz.coffee.skriptgson.skript.effect.EffMapJsonToList.map(EffMapJsonToList.java:110)
[20:18:46] [Server thread/WARN]: 	at skript-gson-1.1.3.jar//cz.coffee.skriptgson.skript.effect.EffMapJsonToList.lambda$JsonHandlerObject$0(EffMapJsonToList.java:94)
[20:18:46] [Server thread/WARN]: 	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
[20:18:46] [Server thread/WARN]: 	at skript-gson-1.1.3.jar//cz.coffee.skriptgson.skript.effect.EffMapJsonToList.JsonHandlerObject(EffMapJsonToList.java:94)
[20:18:46] [Server thread/WARN]: 	at skript-gson-1.1.3.jar//cz.coffee.skriptgson.skript.effect.EffMapJsonToList.mapE(EffMapJsonToList.java:84)
[20:18:46] [Server thread/WARN]: 	at skript-gson-1.1.3.jar//cz.coffee.skriptgson.skript.effect.EffMapJsonToList.execute(EffMapJsonToList.java:76)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.lang.Effect.run(Effect.java:50)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:56)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.events.EvtScript.runTrigger(EvtScript.java:88)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.events.EvtScript.register(EvtScript.java:68)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.ScriptLoader.lambda$loadScript$7(ScriptLoader.java:811)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:834)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.ScriptLoader.lambda$loadScripts$4(ScriptLoader.java:526)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.ScriptLoader.lambda$makeFuture$2(ScriptLoader.java:418)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.ScriptLoader.makeFuture(ScriptLoader.java:434)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:525)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:469)
[20:18:46] [Server thread/WARN]: 	at Skript.jar//ch.njol.skript.Skript$1.run(Skript.java:786)
[20:18:46] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101)
[20:18:46] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
[20:18:46] [Server thread/WARN]: 	at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1114)
[20:18:46] [Server thread/WARN]: 	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305)
[20:18:46] [Server thread/WARN]: 	at java.base/java.lang.Thread.run(Thread.java:833)

I believe it's occurring in the map function because when I use.
map json from {@json_text} to {json_data::*}
It shows the error but works fine. Instead, if I use.
map json from (json from file {@json_file}) to {json_data::*}
It also works, but the colors are not parsed (sometimes?).

Example:
json as text (on skript)
image
json as file
image

I don’t know if it's my fault or not, but still wanted to post it here.

Custom-Model-Data gets lost with minecraft item type: "bundle"

Describe the bug
Custom-Model-Data gets lost with minecraft item type: "bundle"

To Reproduce
Steps to reproduce the behavior:

  1. Save a bundle to json.
  2. Give a bundle from json.

When saving:
[skJson] [STDOUT] SOURCE: ItemStack{BUNDLE x 1, BUNDLE_META:{meta-type=BUNDLE, display-name={"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":"Paket"}],"text":""}, lore=[{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gray","text":"An: "},{"bold":false,"italic":true,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gray","text":"Kalabweg 1, Daria"}],"text":""}], custom-model-data=1, items=[ItemStack{SPRUCE_WOOD x 64}]}}

When giving:
[10:10:34 INFO]: [skJson] [STDOUT] SOURCE: ItemStack{BUNDLE x 1, BUNDLE_META:{meta-type=BUNDLE, display-name={"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":"Paket"}],"text":""}, lore=[{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gray","text":"An: "},{"bold":false,"italic":true,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gray","text":"Kalabweg 1, Daria"}],"text":""}], items=[ItemStack{SPRUCE_WOOD x 64}]}}

Expected behavior
The custom model data should get loaded correctly.

Broken Map JSON Syntax

Describe the bug
When attempting to map JSON into a Skript variable with the map json syntax, the server implodes.

To Reproduce
Steps to reproduce the behavior:

  1. Run an effect command and read the error. An example is below.
    !map json from "{""_id"": ""93eb06cd-0a1e-4d04-affe-81a59b632815"", ""username"": ""Baezor""}" to {test::*}

Expected behavior
The JSON should be mapped to a variable, but it stops the rest of the script from running instead.

Screenshots
Screen Shot 2023-01-22 at 1 27 28 PM
Screen Shot 2023-01-22 at 1 30 26 PM

Versions

  • Skript Version: 2.6.4
  • skJson Version: 2.6.0
  • Server Version: git-Filter+-"9247091" (MC: 1.19.2)*

Additional context
Add any other context about the problem here.

Giving player item with custom-model-data from json doesn't work -> data gets lost

Describe the bug
When I give a player an item with custom-model-data from json, it doesn't work. The custom model data gets lost.

To Reproduce

  1. Add this code to a skript:
Command /givetomato:
    trigger:
        give player apple with custom model data 1 named "&fTomate"

Command /apple:
    trigger:
        set {_apple} to json from player's tool
        broadcast "%{_apple}%"
        give player {_apple}

On rightclick with apple:
    broadcast json from player's tool
  1. Run /givetomato
  2. Hold the given item in your hand
  3. Run /apple (json outprint: model data is there)
  4. Rightclick with the given item in your hand (json outprint: model data is lost)

Expected behavior
The second output should have also custom model data included.

Cannot read the array length because the value is null

Code:
function Load(p: offline player):
set {_json} to json from file "plugins/Skript/jsonplayerdata/%{_p}'s uuid%.json"
map json {_json} to {playerdata::%{_p}'s uuid%::}
send {playerdata::%{_p}'s uuid%::
}'s form to {_p}

Error:
[12:56:35 ERROR]: #!#!
[12:56:35 ERROR]: #!#! [Skript] Severe Error:
[12:56:35 ERROR]: #!#!
[12:56:35 ERROR]: #!#! Something went horribly wrong with Skript.
[12:56:35 ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[12:56:35 ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[12:56:35 ERROR]: #!#! Here is full list of them:
[12:56:35 ERROR]: #!#! skJson v2.8.6 (https://github.com/SkJsonTeam/skJson) skript-reflect v2.3 (https://github.com/TPGamesNL/skript-reflect) skript-gui v1.3 (https://github.com/APickledWalrus/skript-gui) DiSky v4.11.1 SkBee v2.11.0 (https://github.com/ShaneBeee/SkBee)
[12:56:35 ERROR]: #!#! We could not identify which of those are specially related, so this might also be Skript issue.
[12:56:35 ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[12:56:35 ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[12:56:35 ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[12:56:35 ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[12:56:35 ERROR]: #!#! Only if the author tells you to do so, report it to Skript's issue tracker.
[12:56:35 ERROR]: #!#!
[12:56:35 ERROR]: #!#! Stack trace:
[12:56:35 ERROR]: #!#! java.lang.NullPointerException: Cannot read the array length because the return value of "com.mojang.authlib.yggdrasil.response.ProfileSearchResultsResponse.getProfiles()" is null
[12:56:35 ERROR]: #!#! at com.mojang.authlib.yggdrasil.YggdrasilGameProfileRepository.findProfilesByNames(YggdrasilGameProfileRepository.java:59)
[12:56:35 ERROR]: #!#! at com.destroystokyo.paper.profile.PaperGameProfileRepository.findProfilesByNames(PaperGameProfileRepository.java:44)
[12:56:35 ERROR]: #!#! at net.minecraft.server.players.UserCache.a(UserCache.java:109)
[12:56:35 ERROR]: #!#! at net.minecraft.server.players.UserCache.getProfile(UserCache.java:174)
[12:56:35 ERROR]: #!#! at org.bukkit.craftbukkit.v1_17_R1.CraftServer.getOfflinePlayer(CraftServer.java:1797)
[12:56:35 ERROR]: #!#! at org.bukkit.Bukkit.getOfflinePlayer(Bukkit.java:1094)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.classes.data.BukkitClasses$18.parse(BukkitClasses.java:798)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.classes.data.BukkitClasses$18.parse(BukkitClasses.java:788)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.expressions.ExprParse.get(ExprParse.java:157)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:99)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.function.FunctionReference.execute(FunctionReference.java:289)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.function.EffFunctionCall.execute(EffFunctionCall.java:52)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.Effect.run(Effect.java:50)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.command.Commands.handleEffectCommand(Commands.java:290)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.command.Commands$3$1.call(Commands.java:220)
[12:56:35 ERROR]: #!#! at Skript-2.6.4.jar//ch.njol.skript.command.Commands$3$1.call(Commands.java:217)
[12:56:35 ERROR]: #!#! at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftFuture.run(CraftFuture.java:88)
[12:56:35 ERROR]: #!#! at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
[12:56:35 ERROR]: #!#! at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1567)
[12:56:35 ERROR]: #!#! at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:490)
[12:56:35 ERROR]: #!#! at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1483)
[12:56:35 ERROR]: #!#! at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1282)
[12:56:35 ERROR]: #!#! at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319)
[12:56:35 ERROR]: #!#! at java.base/java.lang.Thread.run(Thread.java:833)
[12:56:35 ERROR]: #!#!
[12:56:35 ERROR]: #!#! Version Information:
[12:56:35 ERROR]: #!#! Skript: 2.6.4
[12:56:35 ERROR]: #!#! Flavor: skriptlang-github
[12:56:35 ERROR]: #!#! Date: 17:14:25.041218900
[12:56:35 ERROR]: #!#! Bukkit: 1.17.1-R0.1-SNAPSHOT
[12:56:35 ERROR]: #!#! Minecraft: 1.17.1
[12:56:35 ERROR]: #!#! Java: 17.0.7 (OpenJDK 64-Bit Server VM 17.0.7+7)
[12:56:35 ERROR]: #!#! OS: Linux amd64 5.19.0-43-generic
[12:56:35 ERROR]: #!#!
[12:56:35 ERROR]: #!#! Server platform: Paper
[12:56:35 ERROR]: #!#!
[12:56:35 ERROR]: #!#! Current node: null
[12:56:35 ERROR]: #!#! Current item: Save("player" parsed as a offline player)
[12:56:35 ERROR]: #!#!
[12:56:35 ERROR]: #!#! Thread: Server thread
[12:56:35 ERROR]: #!#!
[12:56:35 ERROR]: #!#! Language: english
[12:56:35 ERROR]: #!#! Link parse mode: STRICT
[12:56:35 ERROR]: #!#!
[12:56:35 ERROR]: #!#! End of Error.
[12:56:35 ERROR]: #!#!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.