Improvements
Major modules can hold improvements which change the stats of the item. Improvements have a level, and the stats are defined separately for each level of the improvement. Major modules reference the improvement resources that should be available for that module.
Improvements can be defined in JSON files within data/tetra/improvements/
in your datapack, each resource contains an array of improvements.
Improvements resource
Data defining improvements, each resource contains an array of improvement data.
Format:[
{
"key": "example/grip_tape",
"level": 1,
"group": "wrap",
"integrity": -1,
"attributes": {
"generic.attack_speed": 0.05,
"**generic.attack_damage": 0.1
},
"models": [
{
"location": "tetra:items/module/double/handle/basic/improvements/wrap_alt",
"tint": "eebbaf"
}
]
},
{
"key": "example/grip_tape",
"level": 2,
"group": "wrap",
"integrity": -2,
"attributes": {
"generic.attack_speed": 0.1,
"**generic.attack_damage": 0.15
},
"models": [
{
"location": "tetra:items/module/double/handle/basic/improvements/wrap_alt",
"tint": "eebbaf"
}
]
},
{
"key": "example/waxed",
"group": "wrap",
"durability": 200,
"effects": {
"criticalStrike": 15
}
}
]
Improvement data
Standard improvement data
Defines one instance of an improvement, for improvements with multiple levels you'd have one of these per level.
Format:Identifier for the improvement, can be shared across multiple instances with different levels.
The level of the improvement, essentially used to convey the strength of the improvement to the player. Higher levels should probably be better (or worse if this is more of a negative modifier than an improvement).
Improvements with the same group cannot exist on the same module. Useful when some improvements should not be stackable, e.g. a leather wrap and a wool wrap should not be allowed on the same handle. Adding an improvement to a module when another improvement with the same group is present will replace the existing improvement. Schematic requirements can be used to stop the player from adding improvements if an improvement with a specific group is already present on the module.
The durability that the improvement 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 improvements 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 improvement 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.
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 or improvements 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 improvement data
Expands into several improvement instances based on the referenced materials. Stats can be based on material properties, and some material properties are inherited by the expanded instances. Mostly has the same fields as a standard improvement, the values of those fields are merged with what is extracted from the material.
Format:The durability that the improvement 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 improvements 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 improvement 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.
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 improvement, 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 improvement instance.
The material's durabililty will be multiplied by this value the result is added to the durabilityModifier field of the resulting improvement instance, 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 improvement instance.
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.
Relevant localization keys
Keys used for localization entries related to improvements:
tetra.improvement.<improvement_key>.name
: The name of the improvement, displayed in the holosphere and when hovering an improvement in the workbenchtetra.improvement.<improvement_key>.prefix
: (Optional) Would be added as a prefix to the item name when this improvement is presenttetra.improvement.<improvement_key>.description
: The description is displayed when hovering an improvement in the workbench