Replacements

Replacements can be defined in JSON files within data/tetra/replacements/ in your datapack, each resource contains an array of replacements.

Replacements

Data defining replacements, each resource contains an array of replacement data.

Format:
array[
Replacement definition
]

Replacement definition

Tetra items are typically not crafted as the player would place a piece of equipment (vanilla or modded) in the workbench and modify it, turning it into a tetra item. Replacement definitions determine which type item and which modules an item would initially have when converted into a modular item.

Format:
predicateunknown

An item predicate matching the item that is to be turned into a modular item. See item predicate: (https://minecraft.wiki/w/Predicate).

itemoptionalResource location

A reference to the modular item (or the essentially the type of modular item) that the item will be turned into.

archetypeoptionalResource location

Can be used instead of item, references an archetype instead of a modular item. (Archetypes are defined through data, items are registered programmatically)

modules
map[
string
:
array[
string
string
]
]

The modules that the resulting item should be composed of. The key is a slot on the item, the first item in the array is a module reference and the second item is the module variant.

improvementsoptional
map[
string
:
string
]

The improvements that the resulting item should have. The key is split in two parts, "slot:improvement_key", and the value is the improvement level.

Example:
{
  "predicate": {
    "item": "minecraft:wooden_axe"
  },
  "item": "tetra:modular_double",
  "modules": {
    "double/head_left": [
      "double/basic_axe_left",
      "basic_axe/oak"
    ],
    "double/head_right": [
      "double/butt_right",
      "butt/oak"
    ],
    "double/handle": [
      "double/basic_handle",
      "basic_handle/stick"
    ]
  },
  "improvements": {
    "double/head_left:hone/efficiency": 1
  }
}