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. Keys prefixed with '#' are treated as aspect identifiers — a random improvement with that aspect (that's available for the target module) will be selected.

stackingoptionalstring
Allowed values:
add
stackTo
stackFrom
stack
max
replace

Determines how the improvement level interacts with an existing improvement level on the module. 'add' sums the levels, 'stack' always adds the new level on top of the current (treating negative current as 0), 'stackTo' only stacks if the new level is higher than the current, 'stackFrom' only stacks if the new level is lower than the current, 'max' keeps the higher of the two levels, 'replace' always sets the new level regardless of the current value.

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_enchantments
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_enchantments",
  "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. Either the 'effects' or the 'references' fields must be set or this effect will not do anything.

Format:
typetetra:apply_list
effectsoptional
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.

]
referencesoptional
array[
Resource location

Can be used to invoke other crafting effects, can directly reference a crafting effect or all crafting effects in a directory.

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

diminishingMultiplieroptionalnumber

When a multi-item material cost is reduced, each successive reduction multiplies the probability by this value, making further reductions less likely. Set to 1 to disable diminishing returns, set to 0 to allow at most one reduction per craft.

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

Per-slot crafting effect outcome

Applies an outcome once for each module slot on the item, optionally filtering which slots are targeted.

Format:
typetetra:per_slot
outcomeCrafting effect outcome

The outcome to apply for each matching slot.

slotsoptional
array[
string
]

If set, only slots listed here will be targeted. If omitted, all slots are eligible.

excludeoptional
array[
string
]

Slots listed here will be skipped even if they would otherwise be targeted.

currentoptionalboolean

If false, the slot currently being crafted is excluded from the iteration.

majoroptionalboolean

If true, major module slots are included.

minoroptionalboolean

If true, minor module slots are included.

Example:
{
  "type": "tetra:per_slot",
  "outcome": {
    "type": "tetra:apply_improvements",
    "improvements": {
      "some/improvement": 1
    }
  },
  "major": true,
  "minor": false
}

Destabilize crafting effect outcome

NOTE: To add destabilization effects to the regular flow, drop crafting effects with "active": false in "crafting_effects/destabilization/" instead of using this outcome. Applies one or more outcomes based on the destabilization chance of the module in the target slot. Each time destabilization triggers, a random outcome from the list is applied. Can trigger multiple times if the destabilization chance exceeds 1.

Format:
typetetra:destabilize
outcomes
array[
Crafting effect outcome
]

A pool of outcomes to randomly pick from each time destabilization triggers.

Example:
{
  "type": "tetra:destabilize",
  "outcomes": [
    {
      "type": "tetra:apply_improvements",
      "improvements": {
        "destabilized": 1
      }
    }
  ]
}

Explosion crafting effect outcome

Creates an explosion at or near the workbench when the craft completes.

Format:
typetetra:explosion
radiusoptionalnumber

The radius of the explosion.

chanceoptionalnumber

The probability that the explosion occurs. A value of 1 always triggers, a value of 0 never triggers.

randomOriginDistanceoptionalunknown

If greater than 0, the explosion origin is offset by a random amount in each axis up to this distance from the workbench.

Example:
{
  "type": "tetra:explosion",
  "radius": 4,
  "chance": 0.5
}

Lightning strike crafting effect outcome

Summons a lightning bolt at or near the workbench when the craft completes, optionally after a delay with particle effects.

Format:
typetetra:lightning_strike
chanceoptionalnumber

The probability that the lightning strike occurs. A value of 1 always triggers, a value of 0 never triggers.

delayTicksoptionalunknown

Number of ticks to wait before the lightning bolt spawns. Electric spark particles are shown during the delay. Set to 0 for an instant strike.

randomOriginDistanceoptionalunknown

If greater than 0, the lightning target is offset by a random horizontal distance up to this value from the workbench.

Example:
{
  "type": "tetra:lightning_strike",
  "chance": 0.75,
  "delayTicks": 40
}

Spawn effect cloud crafting effect outcome

Spawns an area effect cloud with a mob effect at or near the workbench when the craft completes.

Format:
typetetra:spawn_effect_cloud
effectResource location

The mob effect to apply to entities that walk through the cloud.

amplifieroptionalunknown

The amplifier of the mob effect (0 = level I).

durationoptionalunknown

Duration of the mob effect in ticks when applied to an entity.

cloudDurationoptionalunknown

How long the effect cloud entity persists, in ticks.

waitTimeoptionalunknown

Ticks before the cloud begins applying effects to nearby entities.

radiusoptionalnumber

The initial radius of the effect cloud.

radiusChangeoptionalnumber

Amount by which the cloud radius changes per tick. Negative values shrink the cloud over time.

chanceoptionalnumber

The probability that the cloud spawns. A value of 1 always triggers, a value of 0 never triggers.

randomOriginDistanceoptionalunknown

If greater than 0, the cloud spawn position is offset by a random horizontal distance up to this value from the workbench.

Example:
{
  "type": "tetra:spawn_effect_cloud",
  "effect": "minecraft:poison",
  "amplifier": 1,
  "duration": 200,
  "radius": 3
}

Spawn entity crafting effect outcome

Spawns an entity at or near the workbench when the craft completes. The entity is defined by an NBT compound tag as used by the /summon command.

Format:
typetetra:spawn_entity
entity
idResource location

The entity type to spawn, e.g. 'minecraft:vex'.

NBT compound tag for the entity to spawn. Must include an 'id' field with the entity type resource location.

chanceoptionalnumber

The probability that the entity spawns. A value of 1 always triggers, a value of 0 never triggers.

randomOriginDistanceoptionalunknown

If greater than 0, the spawn position is offset by a random horizontal distance up to this value and up to 2 blocks vertically from the workbench.

particleoptionalunknown

If set, particles are spawned around the entity after it appears.

Example:
{
  "type": "tetra:spawn_entity",
  "entity": {
    "id": "minecraft:vex"
  },
  "chance": 1
}

Spawn sculk crafting effect outcome

Spreads sculk growth from a surface adjacent to the workbench or a nearby sculk catalyst.

Format:
typetetra:spawn_sculk
severityoptionalunknown

Controls how aggressively the sculk spreads.

chanceoptionalnumber

The probability that sculk spreads. A value of 1 always triggers, a value of 0 never triggers.

catalystSourceoptionalboolean

If true, sculk will try to spread from a sculk catalyst within 2 blocks of the workbench.

workbenchSourceoptionalboolean

If true, sculk will try to spread from a surface adjacent to the workbench.

Example:
{
  "type": "tetra:spawn_sculk",
  "severity": 5,
  "workbenchSource": true
}

Set blocks crafting effect outcome

Replaces blocks in a radius around the workbench with a specified block state when the craft completes.

Format:
typetetra:set_blocks
blockStatestring

The block state to place, as a resource location. Block properties are not currently supported.

requirementoptionalProperty matcher

A block state property matcher that the existing block must satisfy before it is replaced.

requireReplaceableoptionalboolean

If true, only blocks that are replaceable (e.g. air, grass, snow layers) can be replaced.

solidBelowoptionalboolean

If true, only positions with a solid block directly below are eligible.

solidAdjacentoptionalboolean

If true, only positions with at least one solid block on any face are eligible (useful for placing face-attached blocks like sculk vein).

skipCenteroptionalboolean

If true, the workbench position itself is excluded.

radiusoptionalunknown

Manhattan distance radius around the workbench to search for eligible positions.

countoptionalunknown

Maximum number of blocks to replace per craft.

chanceoptionalnumber

The probability that any blocks are replaced at all.

soundoptional
typeResource location

The sound event resource location.

volumeoptionalnumber
pitchoptionalnumber

Sound to play immediately when a block is placed.

particleoptionalunknown

Particle to spawn when a block is placed.

delayoptionalunknown

Ticks to wait before placing each block.

randomDelayoptionalunknown

Additional random ticks added to the delay (uniform between 0 and this value).

fxIntervaloptionalunknown

Tick interval between interval particles/sounds played during the delay.

intervalParticleoptionalunknown

Particle to spawn repeatedly during the delay at the target position.

intervalSoundoptional
typeResource location

The sound event resource location.

volumeoptionalnumber
pitchoptionalnumber

Sound to play repeatedly during the delay.

intervalSoundVolumeChangeoptionalnumber

Volume change applied to the interval sound on each interval tick.

intervalSoundPitchChangeoptionalnumber

Pitch change applied to the interval sound on each interval tick.

Example:
{
  "type": "tetra:set_blocks",
  "blockState": "minecraft:sculk_vein",
  "radius": 5,
  "count": 3,
  "solidAdjacent": true
}