JsonPatcher

JsonPatcher

A tool for patching minecrafts json files, without overrding them, using a custom DSL

by
11.1K Downloads
fabricquiltlibraryutility
Rent Server with this Mod

About this Mod

JsonPatcher

Badge showing the amount of downloads on modrinth
Badge showing the amount of downloads on curseforge
Badge linking to issues on github
Badge linking to support on discord

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

v1.1.1 [1.21.1]release
MC 1.21.1fabric, quilt
October 31, 2024
v1.1.0 [1.21.1]release
MC 1.21.1fabric, quilt
August 10, 2024
v1.1.0 [1.21]release
MC 1.21fabric, quilt
June 28, 2024
v1.0.0 [1.20.6]release
MC 1.20.6fabric, quilt
May 12, 2024

How to Install JsonPatcher on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.21.1).

3

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

fabricquilt

Minecraft Versions

1.21.1, 1.21, 1.20.6 (+4 more)

Server-side

~ Optional

Recommended 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.

Rent Modded Server

Install JsonPatcher with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Optional

Supported Versions

1.21.11.211.20.61.20.41.20.3-pre21.20.21.20.1