Modules
Modular items have a set of slots which can hold modules. There are major and minor module slots, the item defines which are which. Major modules are denoted by the larger diamond shaped borders, major modules can hold improvements.
Modules have multiple variants (often based on different materials), it's the variants that provide stats and effects.
Most modules can only go in a single slot, but the modules used for the heads of double headed tools or the slots for the belt can fit into several. Data-wise those are considered as a single module but under the hood those are duplicated into different modules for each slot.
Modules can be defined in JSON files within data/tetra/modules/
in your datapack, those resources are typically structured like this: data/tetra/modules/<item>/<module>
, e.g. data/tetra/modules/sword/basic_blade.json
for basic blades.
Module data
Data defining a module and its variants.
Format:If set to true this resource will replace others with the same location, rather than them being merged.
An array of slots that this module can go into, has to contain at least one value.
Use when modules should have different models depending on slot, setting this will effectively generate multiple modules with keys suffixed with values in this array. The suffixes are also applied to model locations for the variants of the module, and for models of any improvements applied to this module. Usable for double headed tool heads, like a pickaxe head. Likely not usable for modules that only go in one slot. Make sure the length of this matches the length of the slots array.
Defines the type of the module. Built in types are listed as examples, but addons may add additional types.
An array of references to improvement resources that this module should be able to hold, only applicable for major modules. Can (and should) reference folders to allow for compatibility between addons, see structure in the examples.
Defines the layer that this module's textures should render on, default: BASE
The priority for setting the name of the item. Multiple modules may want to provide an item name e.g. hammer, or pickaxe, and this field is used to prioritize that. Default: BASE
The priority for setting the prefixes of the item. Multiple modules may want to provide a name prefix e.g. Iron Pickaxe, Tempered steel axe, or Serrated copper shortblade. Only two prefixes are displayed and when more than two are available, this field is used to prioritize which prefixes are used. Default: BASE
{
"replace": false,
"slots": [
"sword/blade"
],
"type": "tetra:basic_major_module",
"improvements": [
"tetra:sword/basic_blade/",
"tetra:sword/shared_blade/",
"tetra:sword/shared/",
"tetra:shared/"
],
"variants": [
{
"key": "example_blade/iron",
"attributes": {
"generic.attack_speed": -1.9,
"generic.attack_damage": 5
},
"effects": {
"sweeping": 1
},
"tools": {
"cut": [
1,
2
]
},
"aspects": {
"edged_weapon": 2,
"breakable": 2
},
"integrity": -1,
"durability": 200,
"magicCapacity": 84,
"tags": [
"forge:swords"
],
"glyph": {
"textureX": 46,
"textureY": 16,
"tint": "ecafbd"
},
"models": [
{
"location": "tetra:items/module/sword/blade/example/metal"
}
]
},
{
"materials": [
"tetra:wood/",
"tetra:bone/"
],
"key": "basic_blade/",
"attributes": {
"generic.attack_speed": -1.9
},
"effects": {
"sweeping": 1
},
"tools": {
"cut": [
1,
2
]
},
"aspects": {
"edged_weapon": 2,
"breakable": 2
},
"durability": -20,
"tags": [
"forge:swords"
],
"extract": {
"primaryAttributes": {
"generic.attack_damage": 1
},
"durability": 0.9,
"integrity": -1,
"magicCapacity": 1,
"glyph": {
"textureX": 0
},
"availableTextures": [
"metal",
"shiny",
"grainy",
"crude"
],
"models": [
{
"location": "tetra:item/module/sword/blade/basic/"
}
]
}
}
]
}
Module variant data
Variant data for modules, there are two different types of variants: standard and material variants. Material variants can inherit properties from a material.
Standard module variant data
Directly defines a single module variant.
Format:Identifier for the variant, should be unique.
The category is used when grouping variants in the holosphere UI, the localization key used for the displayed value is 'tetra.variant_category.<value>.label'.
The durability that the module provides, called item damage in vanilla minecraft. A higher value makes the item last longer before it needs repairs. Swords lose one point of durability when hitting entities and two points when destroying blocks, for tools it's the opposite.
Multiplies the durability of the item. A value of 2.0 would double the durability of the item, a value of 1.0 would cause no change.
Integrity is used for balancing and acts as a capacity for how many modules and improvements an item can hold. Some modules provide integrity while some have an integrity cost, if an upgrade would cause the cost to exceed the available integrity the upgrade would not be possible. A negative value represents an integrity cost while positive values cause the module to provide integrity.
The magic capacity determines how many enchantments a module can hold before it starts to suffer from destabilization effects. A higher value is better. Only relevant for major modules since those are the only ones that can hold enchantments.
A map of attributes, used to add damage, armor, toughness, attack speed or reach/range to an item.
{
"edged_weapon": 1
}
Aspects determine how a module can be modified by improvements and enchantments. Schematics may require an aspect to be present or to be of a specific level for it to be applicable for a module. Vanilla enchantment categories match against a set of aspects. For enchantment aspects level 1 allows the enchantment to be applied using books and level 2 allows the enchantment to be applied using an enchanting table.
The rarity of the item is determined by the module or improvement with the highest rarity value. Vanilla values listed as examples, but other mods may add more.
The priority for setting the prefixes of the item. Multiple modules may want to provide a name prefix e.g. Iron Pickaxe, Tempered steel axe, or Serrated copper shortblade. Only two prefixes are displayed and when more than two are available, this field is used to prioritize which prefixes are used. Default: BASE
Material module variant data
Expands into several module variants based on the referenced materials. Stats can be based on material properties, and some material properties are inherited by the expanded variants. Mostly has the same fields as a standard module variant, the values of those fields are merged with what is extracted from the material.
Format:The durability that the module provides, called item damage in vanilla minecraft. A higher value makes the item last longer before it needs repairs. Swords lose one point of durability when hitting entities and two points when destroying blocks, for tools it's the opposite.
Multiplies the durability of the item. A value of 2.0 would double the durability of the item, a value of 1.0 would cause no change.
Integrity is used for balancing and acts as a capacity for how many modules and improvements an item can hold. Some modules provide integrity while some have an integrity cost, if an upgrade would cause the cost to exceed the available integrity the upgrade would not be possible. A negative value represents an integrity cost while positive values cause the module to provide integrity.
The magic capacity determines how many enchantments a module can hold before it starts to suffer from destabilization effects. A higher value is better. Only relevant for major modules since those are the only ones that can hold enchantments.
A map of attributes, used to add damage, armor, toughness, attack speed or reach/range to an item.
{
"edged_weapon": 1
}
Aspects determine how a module can be modified by improvements and enchantments. Schematics may require an aspect to be present or to be of a specific level for it to be applicable for a module. Vanilla enchantment categories match against a set of aspects. For enchantment aspects level 1 allows the enchantment to be applied using books and level 2 allows the enchantment to be applied using an enchanting table.
Determines the rarity of the module, if the material has a higher rarity than this value then that value will be used instead.
A map of attributes, will be multiplied by the material's primary multiplier.
A map of attributes, will be multiplied by the material's secondary multiplier.
A map of attributes, will be multiplied by the material's tertiary multiplier.
The material's durabililty will be multiplied by this value and the product is added to the resulting module variant.
The material's durabililty will be multiplied by this value the result is added to the durabilityModifier field of the resulting module variant, this can get a bit wonky as material durability varies significantly.
Defines integrity gain/cost that should be based on the material's integrity factor. Decimal value are allowed, the result will be rounded off to the nearest integer.
The material's magic capacity will be multiplied by this value and the product is added to the resulting module variant. You'd often want to set this to 1 for modules that can hold enchantments, otherwise leave it unset.
Texture suffixes available for model textures, the first material texture that matches one of the textures listed here will be used, if none matches the first of the available textures will be used.
Module types
The following module types are available in base tetra:
tetra:basic_module
: Used by most minor modules, e.g. sword guards or bow riserstetra:multi_module
: Used by most major modules, e.g. sword blades or bowstringstetra:basic_major_module
: Used for minor modules that can go in multiple slots, no current usestetra:multi_major_module
: Used for major modules that can go in multiple slots, e.g. double headed tool headstetra:toolbelt_module
: Used for belt attachment modules
Relevant localization keys
Keys used for localization entries related to modules and module variants:
tetra.module.<module_path>.name
: The name of the module, used in synergy tooltipstetra.module.<module_path>.description
: Shown in the module details view in the workbench and in the description tooltip in the holospheretetra.module.<module_path>.item_name
: (Optional) Changes the name of the item when this module is presenttetra.module.<module_path>.prefix
: (Optional) Adds a prefix for the item name when this module is present, items will show the 2 highest priority prefixes. For modules using only material variants this can contain a '%s' which will be replaced with the material nametetra.module.<module_path>.material_name
: Used to determine the variant name for modules with material variants, should contain a '%s' which will be replaced with the material nametetra.variant.<variant_key>
: The name of the variant, used as label for the module in the workbench, the module detail view, in synergy tooltips and in the holosphere variant detail viewtetra.variant.<variant_key>.item_name
: (Optional) Changes the name of the item when this variant is presenttetra.variant.<variant_key>.prefix
: (Optional) Adds a prefix for the item name when this variant is present, items will show the 2 highest priority prefixes.tetra.variant.<variant_key>.description
: (Optional) Shown in the module details view in the workbench, used instead of the module description if presenttetra.variant_category.<category>.label
: The label for the variant category, used in the holosphere