
InexactCIT
Adds CIT-style regular-expression matching to the vanilla conditional models system.
About this Mod
Restoring pattern-based conditional item models.
Purpose
The Custom Item Textures (CIT) mod, originally part of McPatcher and then
Optifine, allowed the replacement of item textures (and models) whose
metadata matched inexact patterns. We now have near-equivalent item-texture
replacement in standard Minecraft with conditional client item types, though
inexact matching is no longer possible. This mod adds CIT replacement with
regular expressions to the new standard conditional item definition system.
Compatibility and Dependencies
- Minecraft: 1.21.8
- Loader: Fabric 0.136.1
Fabric API not required.
Installation
Add the mod JAR to your Fabric mods folder.
Usage (Players)
This mod adds a feature to item model definitions which can be used by
resource pack designers. It is always active when the mod is installed.
Resource Pack Integration (Pack Authors)
The JSON files found at assets/minecraft/item are item definitions.
These are not necessarily the model file used to render an item (i.e. an
item model), which are found at assets/minecraft/models/item.
In an item definition file, the JSON object in the "model" field determines
which model file is used to render an item. Typically, a single item type is
always rendered with the same model, so this object has its "type" set tominecraft:model. But different models can be used for the same item in
different contexts by using "model" objects with other types, such asminecraft:condition and minecraft:select.
This mod adds the inexactcit:match item definition model type. It is
similar to the built-in select type in that it contains a list of models
with associated conditions, and when one condition matches, its associated
model is used to render the item. Unlike Select, the Match conditions are
potentially-inexact regular expressions.
Match item definition models use the same fields as Select, particularly
"property", "component", "cases", and "fallback".
Labeled Field Structure
{ "model":
{ "type": "inexactcit:match"
, "property": ... # Probably always minecraft:component
, "component": ... # Name of component to target
, "cases":
[ { "regex": ... # Regular expression for this case
, "model": { ... } # Item def'n. model used when regexp matches
}
, ... # Another case, as above
, ... # Any number of additional cases
]
, "fallback": { ... } # Item def'n. model used when no case matches
}
}
Required Fields
Regular expression matching is intended for text metadata, so the "property"
field will be minecraft:component. Behavior when "property" is notminecraft:component is as yet untested.
The "component" field should be set to the namespaced ID for the component
that will be tested by the condition, e.g. minecraft:lore,minecraft:custom_name.
The "cases" field must contain a list of JSON objects. Each object is to
contain a "regex" field and corresponding "model" field. These must be a
(Java-flavored) regular expression and an item definition model, respectively.
When the regular expression matches against the contents of the component
named in the "component" field, the corresponding model is used for that item.
The "fallback" field gives a model that is used when none of the "case"
objects match, same as the standard Select.
Example
The following is an example of a Match item definition. It replaces all
wooden hoes whose names include the word "Quarterstaff" with the model atpixelatedvolume:item/quarterstaff.
{ "model":
{ "type": "inexactcit:match"
, "property": "minecraft:component"
, "component": "minecraft:custom_name"
, "cases":
[ { "model":
{ "model": "pixelatedvolume:item/quarterstaff"
, "type": "minecraft:model"
}
, "regex": ".*Quarterstaff.*"
}
]
, "fallback":
{ "model": "minecraft:item/wooden_hoe"
, "type": "minecraft:model"
}
}
, "oversized_in_gui": true
}
Text Comparison
The contents of the field being examined is serialized with toString.
Text-component (JSON) features, section-code formatting, etc, is all pushed
into this comparison string, so there is no way of telling what might come
before or after the text that is visible in-game, or what happens between
lines of multiline compontents.
Regular Expression or Model Errors
An item definition file with a malformed regular expression cannot be read
so the item will appear with the default model (margenta-and-black cube).
The failure (with the faulty file) is logged as an Error at pack-load time.
Multiple Target Components
To give one item multiple replacement rules that use different components
(e.g. one set of rules for lore and one set for custom_name), set the
fallback model to a new Match client item model that selects the second
component.
Status
The ability to match properties other than minecraft:component will be added
eventually. Currently, such matches are accepted without error, but they have
no effect.
Available Versions
How to Install InexactCIT on Your Server
Order Server
Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).
Set fabric Loader
In the panel under "Egg", select the fabric loader and matching Minecraft version (1.21.11).
Install Mod
Open the mod browser in the dashboard and search for "InexactCIT". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.
Compatibility
Mod Loaders
Minecraft Versions
1.21.11, 1.21.10, 1.21.9 (+1 more)
Server-side
✗ UnsupportedRecommended RAM
4 GB(min. 3 GB)Frequently Asked Questions
InexactCIT 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.11). You can switch loaders with one click in the panel.
Is InexactCIT compatible with fabric?
InexactCIT officially supports fabric for Minecraft 1.21.11, 1.21.10, 1.21.9. The Mado dashboard automatically detects incompatible loader combinations.
Server lagging with InexactCIT – how to optimize performance?
Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if InexactCIT 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.
Similar Mods
Rent Modded Server
Install InexactCIT with just one click on your server.