Schematics

Banner showing the schematics list UI

Schematics define how modules are crafted, and how existing major modules can be improved.

Schematics can be defined in JSON files within data/tetra/schematics/ in your datapack, those resources are typically structured like this: data/tetra/schematics/<item>/<module>/<schematic>.json, e.g. data/tetra/schematics/double/basic_pickaxe/basic_pickaxe.json for a basic pickaxe.

Schematic

Data defining a schematic. Schematics determine how modules are crafted, and how existing major modules can be improved.

Format:
replaceoptionalboolean

Marks if this should replace or merge with existing entries (if any) for this schematic definition. The default behaviour for upgrade schematics 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 schematics registered by tetra, which can be useful when one wants to remove something.

localizationKeyoptionalstring

The key used for localized human readable strings such as name and description. If this is not available the key field is used for picking up localized strings instead, which is preferable in most cases. This field is useful when multiple schematics should use the same name, description etc.

slotsoptional
array[
string
]

An array of slots which this schematic is applicable for.

keySuffixesoptional
array[
string
]

Suffixes, used when crafted modules should have different keys depending on slot (e.g. pickaxe head keys end with "_left" or "_right" so that different textures can be used depending on the slot. Optional, but if provided it has to have the same length as the slots field.

materialSlotCountoptionalnumber

The number of material that can be used when crafting with this schematic, currently only a value 0 or 1 is supported.

repairoptionalboolean

States if a repair schematic should also be generated based on this schematic. Useful when the crafted module is repaired using the same materials and tools as if it was crafted.

honeoptionalboolean

Defines if this schematic should only be applicable when the player has a honing attempt available for the item.

requirementoptionalCrafting requirements

If present, this schematic will only be visible and applicable when the game state matches this requirement.

materialRevealSlotoptionalnumber

If set this schematic will only be visible if the player carries at least one itemstack that will produce an outcome if placed in the slot at the provided index.

displayTypeoptionalstring
Allowed values:
other
improvement
minor
major

Defines the outline around the schematic glyph, visible in most views where players interact with the schematic somehow. "minor" and "major" display a similar outline as minor and major modules, "improvement" looks like a major module outline with a plus, "other" has no outline and the outline can instead be part of the glyph.

rarityoptionalstring
Allowed values:
temporary
hone
basic

The rarity of a schematic affects how it is rendered. Colors and effects are used to differentiate between effects.

glyphoptional
textureXoptionalnumber

Horizontal offset (from the left) for the glyph in the sprite sheet

textureYoptionalnumber

Vertical offset (from the top) for the glyph in the sprite sheet

textureLocationoptionalstring

The resource location for the texture where the glyph is located.

The glyph displayed for this schematic, preferably the same as the module it will be used to craft but with no tint.

translationoptional

Used to display some information about how material properties translate into stats for the module or improvement that the schematic crafts.

applicableMaterialsoptional
array[
string
]

Used to display hints about which materials that can be used for this schematic, strings starting with # are considered as materials, others as item IDs.

outcomesoptional
array[
Schematic outcome data
]

An array of all potential outcomes of this schematic.

Example:
{
  "slots": [
    "double/head_left",
    "double/head_right"
  ],
  "keySuffixes": [
    "_left",
    "_right"
  ],
  "materialSlotCount": 1,
  "glyph": {
    "textureX": 64,
    "textureY": 0
  },
  "displayType": "major",
  "outcomes": [
    {
      "material": {
        "tag": "forge:obsidian"
      },
      "requiredTools": {
        "hammer": 6
      },
      "moduleKey": "double/basic_hammer",
      "moduleVariant": "basic_hammer/obsidian",
      "improvements": {
        "arrested": 0
      }
    },
    {
      "materials": [
        "tetra:metal/"
      ],
      "countFactor": 2,
      "toolOffset": 1,
      "moduleKey": "double/basic_hammer",
      "moduleVariant": "basic_hammer/"
    }
  ]
}

Schematic outcome data

Different types of outcomes that can be produced by a schematic.

Standard schematic outcome data

Defines a standard outcome for a schematic, resulting in a new module or an added/updated improvement.

Format:
materialoptional
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.

The required itemstack required for the outcome, basically an item predicate. Required if the schematic which contains this outcome has 1 or more material slots.

materialSlotoptionalnumber

The slot in which to look for the material, this can be set when doing multi-material-schematics. Can be set to a value between 0 (inclusive) and 'materialSlotCount' on the schematic. Not to be confused with the module slots of a modular item.

experienceCostoptionalnumber

The experience cost for the craft, in levels. The player will be required to have this amount of experience, and will lose this amount of levels when crafting something with this outcome.

requiredToolsoptionalTiered data

Defines which tools (and which level of each tool) are required for this outcome. If no tools are required this field can be omitted.

moduleKeyoptionalstring

A key referring to a module. Optional, but the schematic should then apply improvements or the outcome won't do anything.

moduleVariantoptionalstring

A module variant, has to be a variant (matching the 'key' of the variant) of the module specified by the moduleKey field. Optional, but has to be set if the moduleKey field is set.

improvementsoptional
map[
[a-z.]+
:
unknown
]

An object describing which improvements to apply for this outcome, where the key is the improvement identifier and the value is the improvement level. This can be used both with and without the moduleKey being set. Improvements will only be added if that improvement is available for the module in the target slot.

hiddenoptionalboolean

If set to true the outcome will not be visible in the holosphere, but will still be craftable if the requirements are met.

Material schematic outcome data

Defines a material outcome for a schematic, this expands into several outcomes based on the referenced materials.

Format:
materials
array[
Resource location
]

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

materialSlotoptionalnumber

The slot in which to look for the material, this can be set when doing multi-material-schematics. Can be set to a value between 0 (inclusive) and 'materialSlotCount' on the schematic. Not to be confused with the module slots of a modular item.

experienceCostoptionalnumber

The experience cost for the craft, in levels. The player will be required to have this amount of experience, and will lose this amount of levels when crafting something with this outcome.

countFactoroptionalnumber

Multiplies the number of required materials. Decimal values allowed, the result is rounded to the nearest integer.

countOffsetoptionalnumber

Offsets the number of required materials.

toolFactoroptionalnumber

Multiplies the level for required tools defined by the material. Decimal values allowed, the result is rounded to the nearest integer.

toolOffsetoptionalnumber

Offsets the level for required tools defined by the material.

requiredToolsoptionalTiered data

Adds additional tool requirements in addition to those required by the material.

moduleKeyoptionalstring

A key referring to a module. Optional, but the schematic should then apply improvements or the outcome won't do anything.

moduleVariantoptionalstring

A module variant, this value is suffixed with the 'key' field from referenced materials. Optional, but has to be set if the moduleKey field is set.

improvementsoptionalunknown

An object describing which improvements to apply for this outcome, where the key is the improvement identifier and the value is the improvement level. This can be used both with and without the moduleKey being set. Improvements will only be added if that improvement is available for the module in the target slot. The improvement keys listed here are suffixed with the 'key' field from referenced materials.

hiddenoptionalboolean

If set to true the outcome will not be visible in the holosphere, but will still be craftable if the requirements are met.