How to Find and Fix JSON Errors on Your Minecraft Server
Diagnose and fix JSON syntax errors in Minecraft datapacks, resource packs, and mod config files — trailing commas, missing quotes, mismatched brackets.
JSON is the format used by Minecraft datapacks, resource packs, the whitelist.json and ops.json files, many mod configs, and chat component formatting (tellraw, books, signs). Unlike YAML, JSON is whitespace-tolerant — but it's far stricter about commas, quotes, and brackets. A single missing comma will refuse to load the entire file.
The good news: every JSON error is mechanical. Five rules cover 95% of mistakes.
How JSON Errors Appear
In your Console:
[ERROR] com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException:
Unterminated object at line 12 column 5 path $.recipes[3].ingredientsThe path tells you exactly where: $.recipes[3].ingredients means "in the recipes array, at index 3, in the ingredients field".
The Five Most Common JSON Mistakes
Trailing Commas (the #1 mistake)
JSON does not allow a comma after the last item in an object or array.
// WRONG
{
"name": "Steve",
"age": 25,
}
// CORRECT
{
"name": "Steve",
"age": 25
}The same applies to arrays:
// WRONG
["a", "b", "c",]
// CORRECT
["a", "b", "c"]Missing Quotes Around Keys
In JSON, all keys must be quoted with double quotes.
// WRONG
{ name: "Steve" }
// CORRECT
{ "name": "Steve" }This is different from JavaScript, where unquoted keys are allowed. JSON is strict.
Single Quotes Instead of Double
JSON requires double quotes for both keys and string values. Single quotes are not allowed anywhere.
// WRONG
{ 'name': 'Steve' }
// CORRECT
{ "name": "Steve" }Mismatched Brackets
Every { must have a }. Every [ must have a ]. Editors with bracket matching catch this immediately.
// WRONG (missing closing })
{
"settings": {
"enabled": true
}
// CORRECT
{
"settings": {
"enabled": true
}
}Comments
JSON does not support comments. No //, no /* */, no #.
// WRONG (// is not valid JSON)
{
"name": "Steve" // the player
}
// CORRECT (no comments)
{
"name": "Steve"
}Workaround: Some Minecraft files (like
pack.mcmeta) tolerate_commentfields as a convention:"_comment": "this is ignored by Minecraft".
Fix It
Read the Console error
In the XGamingServer Panel, open Console and find the most recent JsonSyntaxException or MalformedJsonException message. Note the file path, line, and column.
Open the file in the panel editor
Click Files in the sidebar. Navigate to the file from the error and open it.
Validate the file online
Copy the entire file content. Paste it into jsonlint.com and click Validate. JSONLint highlights every error with line and column.
Fix the file
Apply the fixes from the five rules above. Most fixes are:
- Remove trailing comma
- Add missing comma between items
- Quote a key
- Replace single quotes with double quotes
- Add the missing
}or]
Save and reload
Click Save Content. Then:
- Datapack: run
/reloadin-game - Resource pack: players need to reload the pack (F3+T or rejoin)
- Mod config: restart the server
Where Minecraft Uses JSON
| File / location | What it does |
|---|---|
whitelist.json, ops.json, banned-players.json, banned-ips.json | Server-level player lists |
world/datapacks/<name>/data/.../recipes/*.json | Custom recipes |
world/datapacks/<name>/data/.../loot_tables/*.json | Custom loot tables |
world/datapacks/<name>/data/.../advancements/*.json | Custom advancements |
world/datapacks/<name>/pack.mcmeta | Datapack metadata |
resourcepack/.../assets/.../models/*.json | Custom model definitions |
resourcepack/pack.mcmeta | Resource pack metadata |
tellraw @a {"text":"hi"} | In-game chat components |
| Mod configs (some mods) | Configuration files |
Tips for Editing JSON
| Tip | Why |
|---|---|
| Use VS Code with the JSON extension | Highlights errors live as you type |
| Use jsonlint.com before saving | Catches issues before upload |
| Pretty-format your JSON (2-space indent) | Makes mismatches visible |
| Use a JSON formatter to fix layout | jsonformatter.org cleans up minified files |
Validate datapacks with /datapack list | Server reports broken packs after /reload |
| Test small datapacks first | Easier to find errors in 10 lines than 1000 |
Common Mistakes
| Mistake | Fix |
|---|---|
| Pasting JSON from a website with smart quotes | Replace " and ' with plain " |
| Comma after the last item | Remove it |
Trying to add // comments | JSON has no comments — remove them |
| Single quotes around strings | Use double quotes |
Numbers with leading zeros (e.g., 007) | JSON forbids leading zeros — use 7 |
| Trailing whitespace inside the file | Should be fine, but some parsers complain |
| File saved as UTF-8 with BOM | Save as plain UTF-8 — BOM breaks Minecraft datapack parsing |
Specific Cases
Datapack Recipes
If a recipe fails to load, run /datapack list to see the broken pack. Re-validate pack.mcmeta and the offending recipe file.
Resource Pack Models
Custom models are very picky. A missing comma breaks the model entirely — the player sees a missing texture cube.
tellraw and Sign Books
These are JSON in chat. Use a generator like minecraft.tools/en/tellraw.php to avoid hand-writing them.
Related Guides
How is this guide?

Fabric Minecraft Server Performance Guide
How to optimize your Minecraft Fabric server with performance mods and configuration.
How to Find and Fix YAML Errors in Minecraft Plugin Configs
Diagnose and fix YAML syntax errors in Minecraft Java plugin config files — indentation, tabs, colons, quotes, and validation tools.