Modular Capabilities and State Variables
CraftingEngine decouples recipes from hardcoded block materials using Capabilities and State Variables. Rather than requiring an ANVIL or FURNACE directly, recipes require abstract traits like forging, heating, or pressure.
1. What are Capabilities?
Capabilities represent functional attributes that workstations or the environment provide:
+---------------------+ +------------------------+| Recipe Requirements | | Workstation Definition |+---------------------+ +------------------------+| - forging | <=======> | capabilities: || - high_temperature | | - forging |+---------------------+ | - high_temperature | +------------------------+Why use Capabilities?
- Multiple Stations, One Recipe: A single “Folded Steel” blueprint can be crafted at a humble Iron Anvil, a massive 3D Runic Forge, or an industrial power press, as long as they provide the
forgingcapability. - Dynamic Tiering: Capabilities can define levels (e.g.
heating_tier_1,heating_tier_2). - Conditional Activation: A workstation may provide a capability only when powered by redstone or heated by lava below.
2. Defining Capabilities (capabilities/*.yml)
Capabilities can be defined as standalone YAML files inside plugins/CraftingEngine/capabilities/:
id: "high_temperature"name: "<gradient:#ff8a80:#ff5252>High Temperature</gradient>"description: "Requires ambient heat exceeding 300°C."
# Conditions required for this capability to be considered activeevaluations: - type: "BLOCK_STATE" offset: [0, -1, 0] # Inspect block underneath the station materials: - "LAVA" - "MAGMA_BLOCK" - "SOUL_FIRE"
variables: temperature: initial: 350.0 decay_rate: 1.53. State Variables Storage
Workstations and active processes maintain isolated, sealed state variable maps:
temperature: Current heat level in °C.fluid_level: Millibuckets (mB) of fluid present in a basin.pressure: Hydraulic or steam pressure in PSI.durability: Structural integrity of custom workstation blocks.
Referencing Variables in Blueprints
You can check state variables directly within blueprint condition expressions:
requirements: conditions: - id: "heat_check" environment: "craftingengine" condition: "capability.temperature >= 250"Next Steps
- Workstations & Multiblocks - Learn how stations bind and evaluate capabilities.
- Fluid Basins - See temperature and fluid state variables in action.
- Lua Scripting - Access and manipulate state variables via Lua scripts.