The Hordes

The Hordes

5M Downloads

Not a JSON Array

wumengzhixing opened this issue ยท 2 comments

commented

In 1.18.2, I learned from the example in the wiki and wrote a Logical condition, but failed, indicating Not a JSON Array, could you please help me check it?

script:
{ "function": "hordes:set_spawntable", "value": "hordes:random", "conditions": { "name": "hordes:or", "value": [{ "name": "hordes:comparison", "value": { "type": "int", "operation": ">=", "value1": { "name": "hordes:player_nbt", "value": "XpLevel" }, "value2": 15 } }, { "name": "hordes:biome", "value": "minecraft:swamp" }] } }

log:
2024-03-12 12:08:21.7719353: java.lang.IllegalStateException: Not a JSON Array: {"name":"hordes:or","value":[{"name":"hordes:comparison","value":{"type":"int","operation":">=","value1":{"name":"hordes:player_nbt","value":"XpLevel"},"value2":15}},{"name":"hordes:biome","value":"minecraft:swamp"}]} 2024-03-12 12:08:21.7729325: Error loading script hordes:random null Not a JSON Array: {"name":"hordes:or","value":[{"name":"hordes:comparison","value":{"type":"int","operation":">=","value1":{"name":"hordes:player_nbt","value":"XpLevel"},"value2":15}},{"name":"hordes:biome","value":"minecraft:swamp"}]} 2024-03-12 12:08:21.7749253: loaded horde script hordes:random

commented

Is that the script that errored, because the error doesn't quite match the script.

Try surrounding that whole section with [ ]

commented

Is that the script that errored, because the error doesn't quite match the script.

Try surrounding that whole section with [ ]

Sorry, maybe my expression is not very good, I copied the Logical Conditions in the wiki to write a random probability to generate Horde Scripts on the fourth day, but it failed. So I used the wiki example to test and found that the prompt was Not a JSON Array