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].ingredients

The 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 _comment fields 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 /reload in-game
  • Resource pack: players need to reload the pack (F3+T or rejoin)
  • Mod config: restart the server

Where Minecraft Uses JSON

File / locationWhat it does
whitelist.json, ops.json, banned-players.json, banned-ips.jsonServer-level player lists
world/datapacks/<name>/data/.../recipes/*.jsonCustom recipes
world/datapacks/<name>/data/.../loot_tables/*.jsonCustom loot tables
world/datapacks/<name>/data/.../advancements/*.jsonCustom advancements
world/datapacks/<name>/pack.mcmetaDatapack metadata
resourcepack/.../assets/.../models/*.jsonCustom model definitions
resourcepack/pack.mcmetaResource pack metadata
tellraw @a {"text":"hi"}In-game chat components
Mod configs (some mods)Configuration files

Tips for Editing JSON

TipWhy
Use VS Code with the JSON extensionHighlights errors live as you type
Use jsonlint.com before savingCatches issues before upload
Pretty-format your JSON (2-space indent)Makes mismatches visible
Use a JSON formatter to fix layoutjsonformatter.org cleans up minified files
Validate datapacks with /datapack listServer reports broken packs after /reload
Test small datapacks firstEasier to find errors in 10 lines than 1000

Common Mistakes

MistakeFix
Pasting JSON from a website with smart quotesReplace " and ' with plain "
Comma after the last itemRemove it
Trying to add // commentsJSON has no comments — remove them
Single quotes around stringsUse double quotes
Numbers with leading zeros (e.g., 007)JSON forbids leading zeros — use 7
Trailing whitespace inside the fileShould be fine, but some parsers complain
File saved as UTF-8 with BOMSave 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.

How is this guide?

40% Off — Limited TimeGet your Minecraft server todayInstant setup, DDoS protection, and 24/7 support included.
Get a Server

On this page