Crafting Effects requirements

Crafting effects requirements determine when a crafting effect should apply. New requirements can be registered by calling CraftingEffectRegistry.registerConditionType in your mod constructor.

Crafting effect requirements

Crafting effect requirements are used to determine if a crafting effect should apply.

And crafting requirement

Passes if ALL of the given requirements pass.

Format:
typetetra:and
requirements
array[
Crafting effect requirements
]

All requirements in this array must pass for this requirement to pass.

Example:
{
  "type": "tetra:and",
  "requirements": [
    {
      "type": "tetra:never"
    },
    {
      "type": "tetra:never"
    }
  ]
}

Or crafting requirement

Passes if ANY of the given requirements pass.

Format:
typetetra:or
requirements
array[
Crafting effect requirements
]

At least one requirement in this array must pass for this requirement to pass.

Example:
{
  "type": "tetra:or",
  "requirements": [
    {
      "type": "tetra:never"
    },
    {
      "type": "tetra:never"
    }
  ]
}

Not crafting requirement

Passes if the given requirement does NOT pass.

Format:
typetetra:not
requirementCrafting effect requirements

The parent requirement passes if this requirement does not.

Example:
{
  "type": "tetra:not",
  "requirement": {
    "type": "tetra:never"
  }
}

Craft type crafting requirement

Passes if the type of craft performed matches the given type.

Format:
typetetra:craft_type
craftstring
Allowed values:
module
improvement
enchantment
repair

Determined by the schematic outcome (or the schematic itself for repairs).

Example:
{
  "type": "tetra:craft_type",
  "craft": "module"
}

Accepts improvement crafting requirement

Passes if the module in the target slot accepts the given improvement, optionally at the given level. todo: change the level field to use an integer predicate (breaking change).

Format:
typetetra:improvement
improvementstring

Passes if the module in the target slot accepts an improvement with a key matching this value. Accepts as in the module references an improvements resource which define an improvement with the key.

leveloptionalInteger predicate

The level of the improvement has to match this predicate if present.

anySlotoptionalboolean

If true, any of the modules on the item can fulfill this requirement (not just the module in the target slot).

Example:
{
  "type": "tetra:improvement",
  "improvement": "blade/serrated",
  "level": 5
}

Aspect crafting requirement

Passes if the module (including its improvements) in the target slot has the given aspect, optionally matching the given level predicate.

Format:
typetetra:aspect
aspectstring

The module (including its improvements) in the target slot has to have this aspect.

leveloptionalInteger predicate

The level of the aspect has to match this predicate if present.

anySlotoptionalboolean

If true, any of the modules on the item can fulfill this requirement (not just the module in the target slot).

Example:
{
  "type": "tetra:aspect",
  "aspect": "edged_weapon",
  "level": {
    "min": 2
  }
}

Locked crafting requirement

Passes if some nearby block provides a crafting effect key matching the given key, the providing block typically determines under which conditions it wants to provide its effect(s).

Format:
typetetra:locked
keyResource location

This crafting effect key that has to be provided by a nearby block.

Module crafting requirement

Passes if the module in the target slot matches the given parameters. When it makes sense to use, using aspects instead of relying on this requirement would make for better compat between addons. Omitting all fields would make this requirement pass if a module is present in the target slot, but fail if it's empty.

Format:
typetetra:module
moduleoptionalstring

The key of the module has to match this if present.

variantoptionalstring

The key of the module variant has to match this if present.

anySlotoptionalboolean

If true, any of the modules on the item can fulfill this requirement (not just the module in the target slot).

Example:
{
  "type": "tetra:module",
  "module": "double/adze_right"
}

Material crafting requirement

Passes if the module in the target slot matches the given parameters. When it makes sense to use, using aspects instead of relying on this requirement would make for better compat between addons. Omitting all fields would make this requirement pass if a module is present in the target slot, but fail if it's empty.

Format:
typetetra:material
materialunknown

The itemstack used as material for the craft, tested using an item predicate (https://minecraft.wiki/w/Predicate).

Example:
{
  "type": "tetra:material",
  "material": {
    "type": "tetra:material",
    "category": "wood"
  }
}

Schematic crafting requirement

Passes if the used schematic matches the given key.

Format:
typetetra:schematic
schematicstring

The key of the used schematic has to match this.

Example:
{
  "type": "tetra:schematic",
  "module": "double/adze"
}

Slot crafting requirement

Passes if the target slot matches the given slot.

Format:
typetetra:slot
slotstring

The target slot has to match this slot.

Example:
{
  "type": "tetra:slot",
  "slot": "sword/blade"
}