promotional bannermobile promotional banner

Merged Item Models

Merges item model definitions from all enabled resource packs

Merged Item Models

Discord Issue tracker

Since 1.21.4, resource packs customize items with item model definitions (assets/<namespace>/items/<item>.json): renames, custom model data, variants and more. Vanilla reads this file only from the topmost pack, so when two packs change the same item, everything the lower one added is gone.

Merged Item Models merges these files from all enabled resource packs, the right way.

Renames from two packs

Food from two packs

How it works

Packs are merged from top to bottom. Wherever an upper pack falls back to the item's default look, the definition from the pack below is used instead. A fallback is detected automatically when it is:

  • the item's default model, e.g. {"type": "minecraft:model", "model": "minecraft:item/diamond_sword"}, unless the pack replaces that model with its own;
  • an exact copy of the vanilla definition, as packs often do for compasses, clocks, shields and other complex items.

Also:

  • item properties (hand_animation_on_swap, oversized_in_gui, swap_animation_scale) come from the highest merged pack that sets them;
  • a broken file in one pack is skipped, the packs below keep working.

Tested with the top 10 item packs

The 10 most downloaded resource packs on Modrinth for 1.21.11 that change item models, enabled together. In vanilla only one pack can change each item, so at most 160 of their 247 item changes show up, whatever the order. With the mod 242 do. The remaining 5 are packs drawing the same thing differently, like three packs with their own enchanted book textures.

Top 10 item packs, all enabled

  1. Enchantment Outlines by tixul
  2. Even Better Enchants by mythitorium
  3. Visual: Armor Trims by thanos
  4. Fresh Waystones Texture by zozozrob
  5. Theone's Eating Animation Pack by theoness1
  6. Fresh Food by cyber
  7. Patrix 32x by patrixcraft
  8. Enchanted Books: Re-covered by carl_classic
  9. Ashen 16x by Aim_Boot
  10. Beautiful Enchanted Books by Lupin

For resource pack authors

In most cases nothing needs to be done. To control merging explicitly, add mim:properties to any model:

{
  "type": "minecraft:model",
  "model": "minecraft:item/my_sword",
  "mim:properties": { "merge": true }
}
  • "merge": true replaces this model with the definition from the pack below;
  • "merge": false keeps it as is, even if it looks like a fallback.

Without the mod the field is simply ignored.

For mod developers

MergedItemModelsApi.getSourcePack(model) returns the id of the resource pack a model was read from, e.g. vanilla or file/Pack.zip. Useful to show which pack a rename comes from.

Compatibility

The mod is built to stay out of the way of other mods. It only changes how item model files are read, and the result is a regular vanilla item model, so mods that read, change or render item models work with it as usual.

  • Client-side only, no dependencies.
  • Only item model definitions are merged. OptiFine CIT .properties files aren't affected.

Packs in the screenshots: Excalibur by Maffhew, KSEPSP by NotAWhale, Fresh Food by cyber.

Merged Item Models Team

profile avatar
Owner
Forgeborn tier icon
  • 7
    Followers
  • 5
    Projects
  • 133.1K
    Downloads

More from hiword9View all