Minecraft supports comments in JSON, but comments in arrays sometimes don't work
[media][media]Note that the syntax error is on line 20, after the comment.
Attachments
Comments 4
Minecraft supports C style comments in JSON (both /**/ and //). It's perfectly reasonable to have comments in a data format like JSON, especially when it is used to define some behavior. There are some comments in the vanilla entities. If comments are supported in other places, why should they not be supported in arrays? Moreover, comments in an array of objects sometimes work! This really seems like an error in the parsing logic, even the error message indicates that - it reports an error at the end of the array (the ] character), but if it didn't support comments the error would be that // is invalid token. It seems like the comment is parsed successfully, but the parser is left in wrong state after the comment so it doesn't accept some tokens that should be valid.
TL; DR i think this is a bug and minecraft should support comments in arrays
Cleaning up old tickets: This ticket has not been updated recently (~1 year+) so is being closed as Cannot Reproduce. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki
JSON is a data format, I don't think it's supposed to have comments ever. A simple parser drops newlines, and finds your comment that is not a valid JS object so it complains. It's possible the parser may recognize C style comments /* Like This */, but there's no reason for comments in JSON, especially INSIDE an array.