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:{
"type": "tetra:and",
"requirements": [
{
"type": "tetra:never"
},
{
"type": "tetra:never"
}
]
}
Or crafting requirement
Passes if ANY of the given requirements pass.
Format:{
"type": "tetra:or",
"requirements": [
{
"type": "tetra:never"
},
{
"type": "tetra:never"
}
]
}
Craft type crafting requirement
Passes if the type of craft performed matches the given type.
Format:Determined by the schematic outcome (or the schematic itself for repairs).
{
"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: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.
If true, any of the modules on the item can fulfill this requirement (not just the module in the target slot).
{
"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:The module (including its improvements) in the target slot has to have this aspect.
If true, any of the modules on the item can fulfill this requirement (not just the module in the target slot).
{
"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: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:The key of the module has to match this if present.
The key of the module variant has to match this if present.
If true, any of the modules on the item can fulfill this requirement (not just the module in the target slot).
{
"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:The itemstack used as material for the craft, tested using an item predicate (https://minecraft.wiki/w/Predicate).
{
"type": "tetra:material",
"material": {
"type": "tetra:material",
"category": "wood"
}
}
Schematic crafting requirement
Passes if the used schematic matches the given key.
Format:The key of the used schematic has to match this.
{
"type": "tetra:schematic",
"module": "double/adze"
}
Slot crafting requirement
Passes if the target slot matches the given slot.
Format:The target slot has to match this slot.
{
"type": "tetra:slot",
"slot": "sword/blade"
}