Patched

Quick rating

Community listing page, reviews here may not be monitored by the author.

Patched

No reviews yet

Allows data/resource packs to modify parts of json files instead of completely replacing them.

No Theme
No Genre
QoL & Tweaks
Mod Loaders
Forge
NeoForge
Fabric
Quilt
Minecraft
26.2

Community voices

Reviews

List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Show per page
10
25
50
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Where It Runs
Either Side, Better on Both

Works on the client or the server alone, but does more when on both.

About

Project Details

Type
Mod
License
GNU Lesser General Public License v2.1 only
Latest Version
9.0.0+26.1-neoforge

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

About

Description

Patched is a mod that provides the ability for data/resource packs (and mods!) to modify parts of json files, allowing them to avoid outright replacing them. This mod can be used for patching biomes, loot tables, models, and most other json files in the game. Whenever Mojang finally makes entity models data-driven (something that feels more distant with each update), Patched will be able to patch those too, providing a lightweight alternative to OptiFine's CEM (Custom Entity Models).

Here's a list of a few different things one can achieve using Patched:

  • Removing or adding world gen features to biomes
  • Removing or adding criteria to advancements
  • Removing or adding loot to loot tables
  • Modifying recipes
  • Modifying all files that match a pattern (e.g., modifying all biomes)
  • Conditional modifications based on loaded mods or configuration options
  • And much more!

Patched is intended to reduce conflicts between data/resource packs as well as between other mods. It's also intended to ease the maintenance of these files, as you don't have to worry about other parts of the file becoming out of date (such as Minecraft updates that modify a biome you're changing an unrelated part of). 

Patched comes with a few commands to inspect the state of the game (/patchedc for resource packs):

  • "/patched list packs" shows a list of packs that have patches
  • "/patched list patches <pack>" shows a list of patches provided by a given pack
  • "/patched dump patch <pack> <name>" shows the contents of the patch provided by a specified pack
  • "/patched dump file <name>" shows the contents of a file, with comments indicating changes made to the file and by who

How it works

Patched allows creating these so-called "patch" files with the same name as the file being patched. These patches follow the syntax of RFC 6902, with extra features to make it better in a modding context. The mod's documentation details how to write these patches (and what other features are available). 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 would then be placed in a data pack at the location "data/minecraft/worldgen/biome" with the name "plains.json.patch".

In order to avoid performance issues, Patched only looks for patches in packs that say they have any (i.e., it's on an opt-in basis). This is to avoid looking in all 200 some mods in your modpack even though only one actually has patches in it. A pack can enable patching by having this in its pack.mcmeta:

{
  "pack": {
    // ...
  },
  "patched": {
    "format_version": 1 // Indicates to Patched that this pack uses Patched, and therefore contains patches.
  }
}

Compatibility

Patched hooks into the base resource loading code, allowing any json file to be patched — even other patches (in theory). This will be compatible with the majority of mods, as they will have no need to modify this code, and any mod using Minecraft's resource loading (which is kind of a requirement) will gain the benefits of Patched. However, some mods may also change this resource loading code. In newer versions attempts have been made to be compatible with such mods — should they exist — but this also relies on them to perform similarly compatible changes.

Limitations

Unfortunately, some limitations apply to 'merged' resources. To clarify, a merged resource is any resource that Minecraft merges at runtime — most notably tags. In addition to tags, there are a handful more of these resources (all client-side): language files, sounds.json, texture atlas sources, block states, and fonts. The limitation imposed on these files is that only the pack providing them may patch them. The reason for this is that otherwise Patched doesn't know which of the 30 some files the patch should apply to.

In addition to this, on versions older than 1.19.3, vanilla biomes cannot be (directly) patched. This is because in these versions those biomes are hard-coded — that is, there is no file to patch. This can be worked around by having a data pack with lower priority that adds the biomes from say, the world gen export here, but I would just recommend updating to 1.19.3 or higher.

Patched is a mod that provides the ability for data/resource packs (and mods!) to modify parts of json files, allowing them to avoid outright replacing them. This mod can be used for patching biomes, loot tables, models, and most other json files in the game. Whenever Mojang finally makes entity models data-driven (something that feels more distant with each update), Patched will be able to patch those too, providing a lightweight alternative to OptiFine's CEM (Custom Entity Models).

Here's a list of a few different things one can achieve using Patched:

  • Removing or adding world gen features to biomes
  • Removing or adding criteria to advancements
  • Removing or adding loot to loot tables
  • Modifying recipes
  • Modifying all files that match a pattern (e.g., modifying all biomes)
  • Conditional modifications based on loaded mods or configuration options
  • And much more!

Patched is intended to reduce conflicts between data/resource packs as well as between other mods. It's also intended to ease the maintenance of these files, as you don't have to worry about other parts of the file becoming out of date (such as Minecraft updates that modify a biome you're changing an unrelated part of).

Patched comes with a few commands to inspect the state of the game (/patchedc for resource packs):

  • /patched list packs shows a list of packs that have patches
  • /patched list patches <pack> shows a list of patches provided by a given pack
  • /patched dump patch <pack> <name> shows the contents of the patch provided by a specified pack
  • /patched dump file <name> shows the contents of a file, with comments indicating changes made to the file and by who

How it works

Patched allows creating these so-called "patch" files with the same name as the file being patched. These patches follow the syntax of RFC 6902, with extra features to make it better in a modding context. The mod's documentation details how to write these patches (and what other features are available). 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 would then be placed in a data pack at the location data/minecraft/worldgen/biome with the name plains.json.patch.

In order to avoid performance issues, Patched only looks for patches in packs that say they have any (i.e., it's on an opt-in basis). This is to avoid looking in all 200 some mods in your modpack even though only one actually has patches in it. A pack can enable patching by having this in its pack.mcmeta:

{
  "pack": {
    // ...
  },
  "patched": {
    "format_version": 1 // Indicates to Patched that this pack uses Patched, and therefore contains patches.
  }
}

For mods, this information may be placed in the loader-specific metadata file. See the documentation for details.

As another example, this patch adds a custom biome to the "adventuring time" advancement:

[
  {
    "op": "add",
    "path": "/criteria/mydatapack:mybiome",
    "value": {
      "conditions": {
        "player": [
          {
            "condition": "minecraft:entity_properties",
            "entity": "this",
            "predicate": {
              "location": {
                "biome": "mydatapack:mybiome"
              }
            }
          }
        ]
      },
      "trigger": "minecraft:location"
    }
  },
  {
    "op": "add",
    "path": "/requirements/-",
    "value": [ "mydatapack:mybiome" ]
  }
]

Compatibility

Patched hooks into the base resource loading code, allowing any json file to be patched — even other patches (in theory). This will be compatible with the majority of mods, as they will have no need to modify this code, and any mod using Minecraft's resource loading (which is kind of a requirement) will gain the benefits of Patched. However, some mods may also change this resource loading code. In newer versions attempts have been made to be compatible with such mods — should they exist — but this also relies on them to perform similarly compatible changes.

Limitations

Unfortunately, some limitations apply to 'merged' resources. To clarify, a merged resource is any resource that Minecraft merges at runtime — most notably tags. In addition to tags, there are a handful more of these resources (all client-side): language files, sounds.json, texture atlas sources, block states, and fonts. The limitation imposed on these files is that only the pack providing them may patch them. The reason for this is that otherwise Patched doesn't know which of the 30 some files the patch should apply to.

In addition to this, on versions older than 1.19.3, vanilla biomes cannot be (directly) patched. This is because in these versions those biomes are hard-coded — that is, there is no file to patch. This can be worked around by having a data pack with lower priority that adds the biomes from say, the world gen export here, but I would just recommend updating to 1.19.3 or higher.

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~100,000
Total Downloads
CurseForge
~41,000
Modrinth
~66,000
Last Updated
CurseForge
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works