nlipiarski / MCC

Marshal Command Code Syntax Highlighter
GNU General Public License v3.0
14 stars 2 forks source link

JSON/NBT error checking #12

Closed Panossa closed 6 years ago

Panossa commented 7 years ago

I miss JSON error checking. E.g: Valid command: give @p minecraft:stick 1 0 {display:{Lore:["aaaa","bbbb"]}} First invalid JSON: give @p minecraft:stick 1 0 {display:{Lore:["aaaa","bbbb"}} Second: give @p minecraft:stick 1 0 {display:{Lore:["aaaa","bbbb"]} Third: give @p minecraft:stick 1 0 display:{Lore:["aaaa","bbbb"]}} Others: give @p minecraft:stick 1 0 display:{Lore:["aaaa""bbbb"]}}

Only commands like give @p minecraft:stick 1 0 display:{Lore:["aaaa"bbbb"]}} are displayed as an invalid command.

Also it would be cool if the highlighter would know where in the command a json/nbt tag list is supposed to be. E.g. /give @p minecraft:stick 1 {display:{Lore:["aaaa","bbbb"]}} and /give @p minecraft:stick {display:{Lore:["aaaa","bbbb"]}} are wrong.

~~Oh and commands like entitydata @e {customTag:1} ...are highlighted as if they are an error. Custom tags are a legit method to identify entities used in mapmaking. But it's displayed as an error.~~

nlipiarski commented 7 years ago

As the highlighter is set up right now, checking the errors you have shown is practically impossible. I am currently working on a rewrite of the system that will allow for checking errors like that, but I don't know when it will be done. Also, I couldn't find any documentation for the customTag NBT tag, are you sure it's used in the current version of Minecraft? Just sit tight for now.

Panossa commented 7 years ago
  1. I didn't say the change is urgent ^^
  2. I didn't find any documentation on custom tags either but I used them myself and they worked at least in 1.11. I tested it in 1.12 and it seems not to work any more.
Panossa commented 7 years ago

Another problem that would be fixed by json error handling:

summon armor_stand ~ ~ ~ {NoGravity:1b,}

...is displayed as a valid command.

nlipiarski commented 6 years ago

This has been fixed in the beta 1.13 version.