
JsonPatcher
A tool for patching minecrafts json files, without overrding them, using a custom DSL
About this Mod
JsonPatcher
JsonPatcher is a mod that allows you to modify json files in datapacks and resourcepacks without overriding them.
This is primarily useful for mod developers and pack makers, but can also be used by players to modify their own packs.
V2 Disclaimer
JsonPatcher v2 is currently in beta. V2 introduces a bunch of new features including global patches for mods and modpacks.
Documentation for v2 is available at jsonpatcher-docs.mattidragon.dev.
The documentation is however quite incomplete and partially outdated.
For some cases it might be best to consult the old wiki instead.
Usage
Gradle dependency (for mod developers)
You can add jsonpatcher to your mods buildscript like this:
repositories {
maven {
url 'https://jitpack.io'
}
}
dependencies {
modImplementation(include("com.github.mattidragon:jsonpatcher:${jsonpatcher_version}"))
}
To begin using jsonpatcher, just create a file with the .jsonpatch extension
in the data/<namespace>/jsonpatch directory of your datapack
or assets/<namespace>/jsonpatch directory of your resourcepack.
You'll want to begin your patch with a @version meta tag like this.
This will let jsonpatcher know that your patch will work with this version.
In the future you may be able to select a version in more ways.
@version "1"
Next you'll want to select the files you want to patch.
This is done with the @target meta tag. All meta tags follow a json format.
You can either select a single file with a string, use an object for broader selections,
or use an array for multiple selections. If any selector in the array matches, the patch will apply.
Now you can begin modifying the target file. The patch files use a c-like syntax.
You can access the target files contents with $. It can be used like a variable,
or you can put the property you want to access directly after it.
For more info on the language, see the wiki.
Available Versions
How to Install JsonPatcher on Your Server
Order Server
Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).
Set fabric Loader
In the panel under "Egg", select the fabric loader and matching Minecraft version (1.21.1).
Install Mod
Open the mod browser in the dashboard and search for "JsonPatcher". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.
Compatibility
Mod Loaders
Minecraft Versions
1.21.1, 1.21, 1.20.6 (+4 more)
Server-side
~ OptionalRecommended RAM
4 GB(min. 3 GB)Frequently Asked Questions
JsonPatcher server crashes on startup – what to do?
Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.1). You can switch loaders with one click in the panel.
Is JsonPatcher compatible with fabric and quilt?
JsonPatcher officially supports fabric, quilt for Minecraft 1.21.1, 1.21, 1.20.6. The Mado dashboard automatically detects incompatible loader combinations.
Server lagging with JsonPatcher – how to optimize performance?
Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if JsonPatcher consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.
Similar Mods
Rent Modded Server
Install JsonPatcher with just one click on your server.