Variants-CIT
This modification offers an optimized CIT format for items with standardized variations.
While this mod doesn't have the same flexibility as OptiFine, it excels in situations where one item has multiple variations based on the same data. It demonstrates better performance when working with huge amounts of CIT resources and uses a less redundant resource format, requiring only one short file to configure all possible variants at once.
Resource Pack Format
The format is based on automatically matching item variations with models or textures that have corresponding names. Instead of defining conditions for each individual CIT, you create a single rule that manages all CITs in a collection (so-called modules). These modules determine which items are affected, how their variations are determined, and where their models are located.
For example, here's a simple module that changes the texture of enchanted books:
{
"type": "stored_enchantment", // Module behavior
"items": "minecraft:enchanted_book", // Affected item types
"modelPrefix": "item/book_cit/", // Folder with possible models/textures
"modelParent": "item/generated", // Automatic model generation from texture (if models are missing)
"parameters": { // Additional options specific to the module type
"levelSeparator": "lvl" // Include enchantment level in variation ID
}
}
In this case, a book with the enchantment minecraft:unbreaking at level 2 will get the variation ID minecraft:unbreaking_lvl_2 and will use the texture stored at /assets/minecraft/texture/item/book_cit/unbreaking_lvl_2.png. This single module will work for all possible enchantments — both vanilla and mod-added — provided the corresponding texture exists.
The module type shown above has special logic for enchanted books. If no suitable module type exists for a specific component, you can still use more universal modules to get a variation from any component:
{
"type": "component_data",
"items": "minecraft:suspicious_stew",
"modelPrefix": "item/suspicious_stew_cit/",
"parameters": {
"componentType": "suspicious_stew_effects", // Component containing the variation ID
"nbtPath": "[0].id" // Location of the variation ID in the component
}
}
At a higher level, you can create variations by combining multiple pieces of data from various components:
{
"type": "component_format",
"items": "minecraft:diamond_sword",
"modelPrefix": "item/trimmed_diamondsword/",
"parameters":{
"format": "${pattern}${material}", // Method of combining various data into a variation ID
"variables": { // Where to find these data pieces
"pattern": {
"componentType": "trim",
"nbtPath": ".pattern"
},
"material": {
"componentType": "trim",
"nbtPath": ".material",
"transform": "discard_namespace"
}
}
}
}