How to Write a Commented JSON5 Config File for a CorgiLib Mod
CorgiLib swaps out the usual strict .json config format for .json5, which lets you leave notes inside the file without breaking it. This is the main reason you'll interact with the library as a player or pack maker.
Finding and Editing the File
Open your instance's config folder and look for files ending in .json5 belonging to the mod you're configuring. Open one in a plain text editor — not a JSON validator, since strict validators will complain about comments. You'll see key/value pairs just like normal JSON, but with extra syntax available.
Adding Comments and Trailing Commas
CorgiLib's serializer accepts two comment styles:
//for a comment that runs to the end of the line/* ... */for a block comment spanning multiple lines
You can also leave a comma after the final entry in an object or array without causing a parse error. This makes it easy to comment out a single line by prefixing it with // rather than deleting it, so you can restore the default later.
Practical Tips
Keep comments on their own lines above the value they describe. If the game fails to load the config, revert your last edit — a stray unclosed /* will swallow everything after it. Because comments are preserved by the codec, you can hand a commented config to another player and they'll still see your notes.