JsonPatcher
JsonPatcher is a modification that enables editing JSON files in datapacks and resourcepacks without requiring their complete replacement. This tool will be particularly useful for mod developers and game pack creators, but can also be handy for regular players to customize their own packs.
Important Information About Version 2
Currently, JsonPatcher v2 is in beta testing. The new version adds numerous features, including global patches for mods and modpacks. Documentation is available at jsonpatcher-docs.mattidragon.dev, however it is currently incomplete and partially outdated. In some cases, it's better to refer to the old version of the wiki.
How to Use
To start working with JsonPatcher, simply create a file with the .jsonpatch extension in the data/
It's recommended to begin the patch with the @version meta-tag, which specifies compatibility with a specific mod version:
@version "1"
Next, you need to specify target files for applying patches using the @target meta-tag. All meta-tags use JSON format. You can select an individual file with a string, apply an object for broader selection, or use an array for multiple selection - the patch will apply if any of the selectors match.
The file modification process itself uses syntax similar to the C language. To access the contents of target files, the $ symbol is used, which can be utilized as a variable or you can immediately specify the desired property after it.
More detailed information about the patching language can be found in the project wiki.