Patched - Mod for Partial JSON File Modification
Patched is an innovative mod that opens up new possibilities for working with JSON files in Minecraft. Instead of completely replacing files as in the standard system, Patched allows making targeted changes to specific parts of JSON documents.
Main Features
With this mod you can:
- Add or remove world generation features in biomes
- Modify advancement achievement conditions
- Customize loot tables by adding or removing items
- Change crafting recipes
- Apply bulk changes to all files matching a specific pattern
- Create conditional modifications based on installed mods or configuration settings
How It Works
The system uses special "patch" files that follow an extended RFC 6902 syntax adapted for modding needs. For example, to remove gravel from the plains biome:
{
"op": "find",
"path": "/features/6",
"test": {
"path": "",
"value": "minecraft:ore_gravel"
},
"then": {
"op": "remove",
"path": ""
}
}
This patch is placed in a datapack at the path data/minecraft/worldgen/biome with the name plains.json.patch.
Diagnostic Commands
The mod includes several useful commands for game state analysis:
/patched list packs- shows a list of packs containing patches/patched list patches <pack>- displays patches from the specified pack/patched dump patch <pack> <name>- shows the contents of a specific patch/patched dump file <name>- displays a file with comments about changes made
Performance Optimization
To prevent performance issues, Patched only checks packs that explicitly indicate patch usage. This is achieved by adding a special section to the pack.mcmeta file:
{
"pack": {
// ...
},
"patched": {
"format_version": 1 // Indicates that this pack uses Patched
}
}
Compatibility and Limitations
The mod integrates into Minecraft's basic resource loading system, ensuring compatibility with most other mods. However, there are some limitations for "merged" resources such as tags, language files, sounds.json, and other client-side resources - only the pack providing these resources can patch them.
It's also worth noting that in versions before 1.19.3, it's impossible to directly patch vanilla biomes since they are hardcoded in the game.