nlipiarski / MCC

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

NTB data runs in MC but is highlighted as incorrect #69

Open MattCM opened 5 years ago

MattCM commented 5 years ago

When summoning an item with a custom name the command runs fine in MC but is highlighted as incorrect in sublime.

image summon item ~ ~ ~ {Item:{id:"minecraft:leather_helmet",Count:1b,tag:{display:{Name:'{"text":"Common Armor Helmet","color":"white","bold":true}',color:16777215},HideFlags:1,Unbreakable:1b}}}

Thanks for any help on this!

MattCM commented 5 years ago

So it likes this. image

execute at @e[type=armor_stand,name=Common_Armor_Helmet] run summon item ~ ~ ~ {Item:{id:"minecraft:leather_helmet",Count:1b},tag:{HideFlags:1,Unbreakable:1b,Enchantments:[{id:"minecraft:protection",lvl:4s},{id:"minecraft:fire_protection",lvl:1s},{id:"minecraft:blast_protection",lvl:1s},{id:"minecraft:projectile_protection",lvl:1s},{id:"minecraft:respiration",lvl:1s},{id:"minecraft:aqua_affinity",lvl:1s}]}}

But when you try to add in the display:{Name: '{"text":"name here"}', color:#} it throws the error,

nlipiarski commented 5 years ago

This is because MCC at the moment does not support single quoted string. You will need to only use double quotes and just escape the quotes in the string until I can update the parser.

This will fix the problem for now: summon item ~ ~ ~ {Item:{id:"minecraft:leather_helmet",Count:1b,tag:{display:{Name:"{\"text\":\"Common Armor Helmet\",\"color\":\"white\",\"bold\":true}",color:16777215},HideFlags:1,Unbreakable:1b}}}

MattCM commented 5 years ago

I see, thanks for the work around @42iscool42 ! I'll check this out across the files as it will allow me to spot other errors. Thanks for getting back to this so quickly!