Skip to content

Validating JSON File

Eivind Norling edited this page May 1, 2023 · 8 revisions

How to Ensure Your OreTweaker.json File is Valid

If you are experiencing issues with OreTweaker and none of the ore generation you have configured seems to work, it is important to ensure that your JSON file is valid and properly configured. Small typos and syntax errors can occur, and they can be hard to spot. Below is a quick guide to help you identify and correct these mistakes.

Error

If the mod crashes with an error message: Malformed JSON its because the one of the files is not properly formatted. OreTweaker-Crash Follow the guide below and take note of the file name and line numbers displayed in the error message.

How to Validate a JSON File:

  1. Copy and paste your JSON file into a JSON validator such as jsonlint.com. It will validate your JSON and highlight any issues in red text.

  2. Read the JSON file line by line slowly, paying close attention to the syntax: `[ ] { } , ``, etc. Alternatively, you can ask someone else to review it since it can be difficult to spot errors after staring at the same file for a long time.

  3. Use a proper text editor tool such as VS Code, Notepad++, Atom, Sublime Text, or any of the online tools available. These tools often provide syntax highlighting and formatting options that can help identify errors.

  4. Refer to the template files generated by OreTweaker in the config/oretweaker/templates folder for guidance. These templates contain examples that can serve as references or be directly copied into your OreTweaker.json file. You can use them side by side as a comparison to identify any mistakes.

JSON Text Editors:

Here are some recommended JSON text editors that offer features specifically tailored for working with JSON files:

Using a dedicated JSON text editor can greatly enhance your experience when working with JSON files, providing features like syntax highlighting, auto-completion, and error checking.

Reference Templates

OreTweaker generates several templates with examples that can be used as references or copied directly into the OreTweaker.json file. These templates can be found in the config/oretweaker/templates folder of your mod installation. You can use them side by side as a comparison to identify any mistakes and ensure that your JSON file follows the correct structure and syntax.

Wiki Pages


Intro


Information

Ore Tweaker 2

Ore Tweaker 3


Configuring

Ore Tweaker 2

Ore Tweaker 3


Debugging


Supported Versions

Version Supported
1.18.x-3.0.x ✔️
1.17.x-2.6.x ✔️
1.16.5-2.6.x ✔️
1.12.x-1.x.x
1.11.x-1.x.x
1.10.x-1.x.x
1.9.x-1.x.x
1.8.x-1.x.x
1.7.x-1.x.x

Versions marked with ❌ is no longer supported. Help to configure these version will not be provided.

Clone this wiki locally