
JsonPatcher
A tool for patching minecrafts json files, without overrding them, using a custom DSL
Обновлён 24 сентября 2025 г. · опубликован 13 ноября 2023 г.
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.
Центр версий
18 версийЧенджлог
2.0.0-beta.7+mc.1.21.1Бета1.21.1 · 24 сентября 2025 г.
- Fixed issue where JsonPatcher would fail to set up its data directories
- Updated language to beta 8
- Fixed various minor issues
2.0.0-beta.6+mc.1.21.1Бета1.21.1 · 24 августа 2025 г.
- Rerelease of beta 5 in order to fix jitpack deployment
2.0.0-beta.5+mc.1.21.1Бета1.21.1 · 24 августа 2025 г.
- Updated language to beta 7, with bugfixes and improvements
- Added
metapatch.searchFilesfor looking up all files in a directory - Added
jsonpatcher-workspace.jsonfiles to folder setup - Fixed a bug where certain patch targets are never checked
- Added and updated docs for built-in code (metapatch and metadata tags)
- The
jsonpatcher:textlibrary is once again available
2.0.0-beta.4+mc.1.21.1Бета1.21.1 · 28 марта 2025 г.
- Fixed crash when loading global patches
- Minor tweaks to generated class names to reduce crashing
- When
throw_on_failureis enabled, global patches now crash the game on failure
2.0.0-beta.3+mc.1.21.1Бета1.21.1 · 24 марта 2025 г.
- Errors in global scripts now show up in the jsonpatcher log
- The main log now only gets a summary
- Updated lang module to beta 3
- Fixed issues with resolving inner classes in reflection
- Implemented loading of resource patches from global directory
- Cleanup of dumping locations
- Expose compiler error nicer
2.0.0-beta.2+mc.1.21.1Бета1.21.1 · 15 марта 2025 г.
- Properly JiJ lang library
- Docs are now emitted upon startup
- Fixes to global patches
- Files not ending in
.jsonpatchare no longer loaded - Errors are now emitted to jsonpatcher logs, similarly to data patches
- Entrypoints are now correctly loaded from the
@initmeta tag
- Files not ending in
2.0.0-beta.1+mc.1.21.1Бета1.21.1 · 15 марта 2025 г.
First beta of v2. This release has overhauled large parts of the language and not everything can be listed here.
Some highlights:
- Replaced tree-walking interpreter with compiler for jvm bytecode
- Noticeable performance uplift
- Expanded standard library
- Minor changes everywhere
- More of the stdlib is now written in jsonpatcher code
- Add reflection library for accessing java code
- Locked by default to patches from mods and modpacks
- Allows for more to be done in jsonpatcher without having to write wrappers in java
- Global patch system for libraries and startup patches for mods and modpacks
- Due to design limitations, metapatches now use a library instead of a global
Lots of improvements have also been done to tooling and the language server, but they will mostly be released at a later time.
1.1.1+mc.1.21.1Релиз1.21.1 · 31 октября 2024 г.
- Fix issue with sided mixin files
Комментарии
Загружаем…