Materials

Banner showing material information in the holosphere

Some properties can now be defined per material and then references from modules and schematics.

Material data is organized in folders based on the type of the material (e.g. wood, metal or skin) with one file/resource per material. Modules and schematics can then reference a specific material (e.g. wood/spruce or misc/bone) or all materials of a type (e.g. wood or metal) and defined how the properties of those materials should be applied for the module.

Material data is loaded from the data/tetra/materials/ folder.

Material

Definition of material data in tetra. Most of the fields in this resource are available on module variants and schematic outcomes and are probably easier to understand when read about in that context.

Format:
replaceoptionalboolean

Marks if this should replace or merge with existing entries (if any) for this schematic definition. The default behaviour for materials added by other mods and datapacks is to merge values set by those into the existing entry (if any). By setting replace to true it's possible to completely replace materials registered by tetra, which can be useful when one wants to remove something.

keystring

Identifier for the material, will be used as suffix for module variants from this material.

categoryoptionalstring

Applied to all module variants from this material.

hiddenoptionalboolean

If set to true, this material will not show up in the holosphere.

hiddenOutcomesoptionalboolean

If set to true, module and improvement variants derived from this material will not show up in the holosphere.

primarynumber

Multiplier for primary attributes & effects. Should represent hardness, sharpness or the ability to shape this material into something with a hard/sharp edge. Material module variants reference this when determining attributes and effects.

secondarynumber

Multiplier for secondary attributes & effects. Should represent material density, rigidity or weight, how much kinetic energy does this carry as it's swung. Material module variants reference this when determining attributes and effects.

tertiarynumber

Multiplier for tertiary attributes & effects. Should represent flexibility or tensile strength, how fast does this material spring back when bent. Material module variants reference this when determining attributes and effects.

durabilitynumber

Durability base, modules use this to determine flat or multiplier durability bonuses.

integrityGainnumber

Multiplier for modules that provide integrity.

integrityCostnumber

Multiplier for modules that consume integrity.

magicCapacityunknown

The magic capacity of major modules variants made from this material.

toolLevelTier

Modules that provide tools that vary based on material use this to determine the level of the tools.

toolEfficiencynumber

Modules that provide tools that vary based on material use this to determine the efficiency of the tools.

effectsoptionalTiered data
Example values:
{
  "stability": 10
}

Effects that will be inherited by modules and improvements crafted from this material.

attributesoptional
map[
string
:
number
]

Innate attributes gained from the material, all modules and improvements crafted from this material will inherit these attributes.

aspectsoptional
map[
string
:
unknown
]

Aspects that will be inherited by modules and improvements crafted from this material. Intended for when the material should affect how a module can be modified by improvements and enchantments.

improvementsoptional
map[
string
:
unknown
]

All major modules made from this material will have these improvements. Useful for when major modules crafted from the material should have some effect but minor modules or improvements should not.

tagsoptional
array[
string
]

Variants and improvements derived from this material will have the tags listed here. Variants and improvements may add additional tags. This is a hacky solution, se schema for module variants for more info.

tintsoptional
glyphoptionalHexadecimal

Hexadecimal string for tinting glyphs in UIs.

textureoptionalHexadecimal

Hexadecimal string for tinting of textures.

textures
array[
string
]

An array of texture suffixes that this material would prefer to use, the first suffix that matches a value in the 'availableTextures' from referencing material variant will be used.

textureOverridesoptional
array[
string
]

Referencing modules with models that have a base path matching one of these values will be forced to use the first texture suffix from this material, even if that suffix is not listed in 'availableTextures'. This is useful if an addon wants to add specific textures for some modules added by base tetra or by another addon. Obsidian has an example for this in base tetra.

tintOverridesoptionalboolean

If set to true, when textures are provided through the 'textureOverrides' method the texture will still be tinted with the material's tint. Leave this as false when the textureOverrides already have colored textures.

material
itemsoptional
array[
Resource location
]

A list of items that can be used as material for this outcome. Either this or the 'tag' field has to be set.

tagoptionalResource location

A tag that can be used to determine if an item can be used as material for this outcome. Either this or the 'items' field has to be set.

nbtoptional
map[
string
:
unknown
]

Can be set if the material stack should have some specific nbt data.

countoptionalnumber

Determines how large the itemstack has to be to match this outcome. This also determines how many items are consumed when crafting.

Defines which item is required by outcomes derived from this material. The count field may be offset or multiplied by the referencing outcome.

requiredToolsoptionalTiered data

Defines the tools (and which levels) that are required by outcomes derived from this material, outcomes may add additional tools and multiply/offset the levels provided here.

experienceCostoptionalnumber

Outcomes derived from this material will have this experience cost, outcomes may add to or subtract from this value.

featuresoptional
array[
string
]

Features are displayed when viewing the material in the holosphere, to be used to describe crafting effect behavior related to this material. E.g. tetracelium uses this to describe how Twilight Forest metals apply different enchantments depending on module type.

Examples:
{
  "key": "oak",
  "category": "wood",
  "primary": "3",
  "secondary": "4",
  "tertiary": "6",
  "durability": "5.2",
  "integrityCost": "1",
  "integrityGain": "4",
  "magicCapacity": "90",
  "toolLevel": "1",
  "toolEfficiency": "2",
  "tints": {
    "glyph": "oak_glyph",
    "texture": "oak"
  },
  "textures": [
    "crude",
    "default"
  ],
  "material": {
    "tag": "minecraft:planks"
  },
  "requiredTools": {
    "axe": 1
  }
}
{
  "key": "diamond",
  "category": "gem",
  "primary": "6",
  "secondary": "7",
  "tertiary": "0",
  "durability": "156.1",
  "integrityCost": "2",
  "integrityGain": "2",
  "magicCapacity": 60,
  "toolLevel": "4",
  "toolEfficiency": "8",
  "tints": {
    "glyph": "diamond_glyph",
    "texture": "diamond"
  },
  "textures": [
    "shiny",
    "crude",
    "default"
  ],
  "material": {
    "item": "minecraft:diamond"
  },
  "improvements": {
    "arrested": 0
  },
  "requiredTools": {
    "hammer": 3
  }
}

Relevant localization keys

Keys used for localization entries related to materials:

  • tetra.material.<material_key>: The name of the material, displayed in the holosphere and in the "applicable materials" tooltip in the workbench
  • tetra.material.<material_key>.prefix: Used to prefix module variants and improvements derived from this material
  • tetra.material.feature.<feature_key>: The label used for a feature, displayed in the holosphere
  • tetra.material.feature.<feature_key>.tooltip: This tooltip is displayed when hovering a feature in the holosphere UI
  • tetra.material.feature.<feature_key>.tooltip_extended: (Optional) This is added to the tooltip while hovering a feature while holding shift

Structure

Vanilla materials are grouped/structured like this:

├── fabric
│   └── wool.json
├── fibre
│   ├── phantom_membrane.json
│   ├── string.json
│   ├── twisting_vine.json
│   ├── vine.json
│   └── weeping_vine.json
├── gem
│   ├── diamond.json
│   └── emerald.json
├── metal
│   ├── gold.json
│   ├── iron.json
│   └── netherite.json
├── misc
│   ├── blaze_rod.json
│   ├── bone.json
│   └── end_rod.json
├── scale
│   └── turtle_scute.json
├── skin
│   ├── hide.json
│   └── leather.json
├── stone
│   ├── andesite.json
│   ├── blackstone.json
│   ├── diorite.json
│   ├── flint.json
│   ├── granite.json
│   ├── obsidian.json
│   └── stone.json
└── wood
    ├── acacia.json
    ├── birch.json
    ├── crimson.json
    ├── dark_oak.json
    ├── oak.json
    ├── spruce.json
    └── warped.json