Improvements

Banner showing improvements in the workbench UI

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:
array[
Improvement data
]
Example:
[
  {
    "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:
keyoptionalstring

Identifier for the improvement, can be shared across multiple instances with different levels.

leveloptionalnumber

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).

groupoptionalstring

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.

durabilityoptionalnumber

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.

durabilityMultiplieroptionalnumber

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.

integrityoptionalnumber

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.

magicCapacityoptionalnumber

The magic capacity determines how many enchantments a module can hold before it starts to suffer from destabilization effects. A higher value is better.

attributesoptional
map[
string
:
number
]

A map of attributes, used to add damage, armor, toughness, attack speed or reach/range to an item.

toolsoptionalTiered data
Example values:
{
  "hammer": 1,
  "cut": [
    "minecraft:iron",
    20
  ]
}

Adds tool capabilities for the item. Efficiency is optional, a single number can be passed instead of an array when omitting the efficiency.

effectsoptionalTiered data
Example values:
{
  "stun": [
    20,
    1.5
  ]
}

Adds item effects for the item. Efficiency is optional, a single number can be passed instead of an array when omitting the efficiency.

aspectsoptionalTiered data
Example values:
{
  "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.

tagsoptional
array[
Resource location
]

Hacky solution to allow modules and improvements to apply tags to an item, possibly useful for mod compat. Works in cases where the functionality uses ItemStack.is to check for tags.

rarityoptionalstring
Example values:
COMMON
UNCOMMON
RARE
EPIC

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.

prefixPriorityoptionalstring
Allowed values:
LOWEST
LOWER
LOW
BASE
HIGH
HIGHER
HIGHEST

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

modelsoptional
array[
Module model
]

A set of models that this improvement should add to the item. The order in which the models are listed here affects how they are layered during rendering, but any 'renderLayer' fields present on the models will take precedence over this order.

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:
materialsoptional
array[
Resource location
]

Can reference material folders or specific materials, referencing folders makes for improved compatability with addons.

durabilityoptionalnumber

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.

durabilityMultiplieroptionalnumber

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.

integrityoptionalnumber

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.

magicCapacityoptionalnumber

The magic capacity determines how many enchantments a module can hold before it starts to suffer from destabilization effects. A higher value is better.

attributesoptional
map[
string
:
number
]

A map of attributes, used to add damage, armor, toughness, attack speed or reach/range to an item.

toolsoptionalTiered data
Example values:
{
  "hammer": 1,
  "cut": [
    "minecraft:iron",
    20
  ]
}

Adds tool capabilities for the item. Efficiency is optional, a single number can be passed instead of an array when omitting the efficiency.

effectsoptionalTiered data
Example values:
{
  "stun": [
    20,
    1.5
  ]
}

Adds item effects for the item. Efficiency is optional, a single number can be passed instead of an array when omitting the efficiency.

aspectsoptionalTiered data
Example values:
{
  "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.

tagsoptional
array[
Resource location
]

Hacky solution to allow modules and improvements to apply tags to an item, possibly useful for mod compat. Works in cases where the functionality uses ItemStack.is to check for tags.

rarityoptionalstring
Example values:
COMMON
UNCOMMON
RARE
EPIC

Determines the rarity of the improvement, if the material has a higher rarity than this value then that value will be used instead.

modelsoptional
array[
Module model
]

These models are added straight up to the resulting improvement instance without being tinted or affected by the material.

extractoptional
primaryAttributesoptional
map[
string
:
number
]

A map of attributes, will be multiplied by the material's primary multiplier.

secondaryAttributesoptional
map[
string
:
number
]

A map of attributes, will be multiplied by the material's secondary multiplier.

tertiaryAttributesoptional
map[
string
:
number
]

A map of attributes, will be multiplied by the material's tertiary multiplier.

primaryEffectsoptionalTiered data

Effects that will be multiplied (both level and efficiency) by the material's primary multiplier.

secondaryEffectsoptionalTiered data

Effects that will be multiplied (both level and efficiency) by the material's secondary multiplier.

tertiaryEffectsoptionalTiered data

Effects that will be multiplied (both level and efficiency) by the material's tertiary multiplier.

durabilityoptionalnumber

The material's durabililty will be multiplied by this value and the product is added to the resulting improvement instance.

durabilityMultiplieroptionalnumber

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.

integrityoptionalnumber

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.

magicCapacityoptionalnumber

The material's magic capacity will be multiplied by this value and the product is added to the resulting improvement instance.

toolsoptionalTiered data

Tools that should be based the level/efficiency on the material, e.g. pickaxe for pickaxes.

glyphoptionalGlyph

The glyph for the improvement, the tint from the material will be used.

modelsoptional
array[
Module model
]

Models that should be tinted and suffixed based on the material.

availableTexturesoptionalunknown

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 workbench
  • tetra.improvement.<improvement_key>.prefix: (Optional) Would be added as a prefix to the item name when this improvement is present
  • tetra.improvement.<improvement_key>.description: The description is displayed when hovering an improvement in the workbench