Crafting Effects outcomes

Crafting effects outcomes determine what happens in a crafting effect. New outcomes can be registered by calling CraftingEffectRegistry.registerEffectType in your mod constructor.

Crafting effect outcome

Crafting effect outcomes are used to make changes to the item as a player modifies a modular item.

Apply improvements crafting effect outcome

Applies the given improvements with the given levels to the target module, if the module is a major module and if the module is able to accept them.

Format:
typetetra:apply_improvements
improvements
map[
string
:
number
]

A list of improvements to apply to the target module, the key is the improvement key and the value is the level of the improvement.

Example:
{
  "type": "tetra:apply_improvements",
  "improvements": {
    "blade/serrated": 1
  }
}

Apply enchantment crafting effect outcome

Attempts to apply a list of enchantments onto the module in the target slot.

Format:
typetetra:apply_enchantment
enchantments
map[
string
:
number
]

A list of enchantments to apply to the target module, the key is the enchantment id and the value is the level of the enchantment.

forceoptionalboolean

If true, the enchantments will be applied even if the target module doesn't have the aspects required by the enchantments.

stackingoptionalstring
Allowed values:
add
stack
max
replace

Determines how the enchantments should be applied if the target module already has enchantments. 'add' will add the given level for conflicting enchantments, 'max' will use the highest level for conflicting enchantments, 'stack' works like 'max' but increments the level by 1 if the given and current levels are equal, 'replace' will override the level of conflicting enchantments with the given level.

Example:
{
  "type": "tetra:apply_enchantment",
  "enchantments": {
    "minecraft:sharpness": 1
  }
}

Apply list crafting effect outcome

Applies a list of crafting effect outcomes. By combining the 'random', 'count' and 'requirement' fields you can use this to apply a random effect, or to apply the first effect in a set depending on some requirements.

Format:
typetetra:apply_list
effects
array[
outcomeCrafting effect outcome

The crafting effect outcome to apply.

requirementoptionalCrafting effect requirements

A condition that must be met for this outcome to be applied. Only outcomes with a passing requirement will be considered when the count field is set.

]
countoptionalnumber

When set this outcome will apply a maximum of this many outcomes. If not set all outcomes will be applied.

randomoptionalboolean

When set to true the outcomes will be applied in a random order.

Example:
{
  "type": "tetra:apply_list",
  "effects": [
    {
      "outcome": {
        "type": "tetra:apply_improvement",
        "improvements": {
          "durable": 1
        }
      }
    },
    {
      "outcome": {
        "type": "tetra:apply_improvement",
        "improvements": {
          "brittle": 1
        }
      }
    }
  ],
  "count": 1,
  "random": true
}

crafting effect outcome

Format:
typetetra:apply_effect
effectResource location

A resource location referencing a mob effect. Vanilla effects can be found here: https://minecraft.wiki/w/Effect

Example:
{
  "type": "tetra:apply_effect"
}

Remove improvement crafting effect outcome

Removes improvements matching the specified keys from the target module.

Format:
typetetra:remove_improvements
improvements
array[
string
]

All improvements matching any of these keys will be removed from the module.

Example:
{
  "type": "tetra:remove_improvements",
  "improvements": [
    "unbound_stonecutter/fractured"
  ]
}

Material reduction crafting effect outcome

Has a chance to reduce the material cost for the craft by 1.

Format:
typetetra:material_reduction
probabilitynumber

The probability that the material cost will be reduced. A value of 1 will always reduce the material cost, while a value of 0 will never reduce the material cost.

Example:
{
  "type": "tetra:material_reduction",
  "probability": 0.5
}