Legacy code to supress info
Threshian opened this issue · 4 comments
Help request
Problem
Hi, I have this error that fail to load the language file on start and every time i reload the plugin. Even after fixing the error it show on the console, the error come back after on reload.What I have tried
I fixed this error :
[{"text":"Ton partenaire t''a envoyé ","color":"green"},{"text":"hoverEvent":{"action":"show_text","value":"{DisplayName}"}},{"text":"{ItemAmount} {ItemName}","hoverEvent":{"action":"show_item","value":"{ItemMetaJSON}"}},{"text":"."}]
To this :
[{"text":"Ton partenaire t''a envoyé ","color":"green"},{"text":"hoverEvent","action":"show_text","value":"{DisplayName}"},{"text":"{ItemAmount} {ItemName}","hoverEvent":{"action":"show_item","value":"{ItemMetaJSON}"}},{"text":"."}]
Could you please share the full content of line 59 from your language file with me.
ItemReceived: "[{"text":"Ton partenaire t''a envoyé ","color":"green"},{"text":"hoverEvent","action":"show_text","value":"{DisplayName}"},{"text":"{ItemAmount} {ItemName}","hoverEvent":{"action":"show_item","value":"{ItemMetaJSON}"}},{"text":"."}]"
Please replace the " at the start and end of the message with ', like this:
ItemReceived: '[{"text":"Ton partenaire t''a envoyé ","color":"green"},{"text":"hoverEvent","action":"show_text","value":"{DisplayName}"},{"text":"{ItemAmount} {ItemName}","hoverEvent":{"action":"show_item","value":"{ItemMetaJSON}"}},{"text":"."}]'
If you use " for the yml string you have to escape every " inside of your json with by putting a \ before it, like this:
ItemReceived: "[{\"text\":\"Ton partenaire t'a envoyé \",\"color\":\"green\"},{\"text\":\"hoverEvent\",\"action\":\"show_text\",\"value\":\"{DisplayName}\"},{\"text\":\"{ItemAmount} {ItemName}\",\"hoverEvent\":{\"action\":\"show_item\",\"value\":\"{ItemMetaJSON}\"}},{\"text\":\".\"}]"
which is tedious and error prone and I would not recommend doing it by hand.