Skip to content

Recipe Capability Reference ​

MBD2 21.1.1
Built-in item, fluid, Forge Energy, and entity Trait handlers in the editor
The core capability rows below map directly to these built-in machine handlers.

The registry name is the stable key used by codecs and MBDRegistries.RECIPE_CAPABILITIES.get(name). The trait type is what a machine must contain for normal handling.

Core capabilities ​

Registry nameJava content typeTrait typeKubeJS builderImportant behavior
itemSizedIngredientitem_slotinputItems, outputItemsMatches item/tag candidates and amount; output must be insertable
item_durabilitySizedIngredientitem_slotinputItemsDurability, outputItemsDurabilityAmount represents durability handled by the durability handler
fluidSizedFluidIngredientfluid_tankinputFluids, outputFluidsMatches fluid/tag and amount; tank filters and IO still apply
forge_energyIntegerforge_energy_storageinputFE, outputFEFE input extracts from storage; output receives into storage
entityEntityIngrediententity_handlerinputEntities, outputEntitiesSupports entity types/tags, count, and optional NBT

An item-slot trait returns both item and durability handlers. A filter, side capability IO, recipe handler IO, and automatic IO are independent settings: allowing a pipe to insert does not automatically make the trait a recipe input.

Optional capabilities ​

Registry nameDependencyTraitKubeJS methodsContent meaning
mek_chemicalMekanismchemical_tankinputChemicals, outputChemicalsChemicalStackIngredient parsed from chemical strings
mek_heatMekanismmek_heat_containerinputHeat, outputHeatHeat amount as double
create_rotationCreateCreate rotation traitinput/outputRPM, input/outputStressTagged union: RPM requirement/generation or stress requirement/generation
pneumatic_pressure_airPneumaticCraftpneumatic_pressure_air_handlerpressure and air methodsPressureAir records whether the number is pressure or air volume
pneumatic_heatPneumaticCraftpneumatic_heat_exchangerinputPNCHeat, outputPNCHeatHeat amount as double
natures_auraNature's Auraaura_handlerinputAura, outputAuraAura amount as integer
ars_sourceArs Nouveauars_source_storage or ars_nearby_sourceinputSource, outputSourceSource amount as integer; the two traits are mutually exclusive

Optional registrations use @LDLRegister(modID = "..."), so the capability is absent when the dependency is not loaded — and the matching KubeJS builder method throws. Guard the call in a pack where the mod can be absent.

Recipe-viewer widget IDs ​

uiName binds a content entry to a named widget in the recipe display UI. When it is empty, MBD2 matches the default generated ID:

text
@<capability>_<io>_<index>      e.g. @item_import_0, @fluid_export_1

<io> is the IO's display name — import for IO.IN, export for IO.OUT.

Set uiName only to override that mapping — for example to send a bonus output to a widget of your own. An explicit uiName is matched as a substring, not as an exact ID; see Slot Names and the Recipe Viewer UI for that, for the reserved @progress_bar / @duration / @condition / @custom_data elements, and for how a Trait declares the slot names slotName is matched against.

Routing fields ​

java
builder.slotName("hot_side")
    .input(HeatUnitsCapability.CAP, 500)
    .slotName(null)
    .uiName("@heat_input")
    .output(HeatUnitsCapability.CAP, 50);

Fluent fields remain active until changed. The KubeJS callback forms restore the previous value automatically and are safer for scoped modifiers. (heat_units is the example Java capability; the lookup throws without it.)

js
ServerEvents.recipes(event => {
  const heat = MBDRegistries.RECIPE_CAPABILITIES.get('heat_units')
  if (heat === null) throw new Error('heat_units capability is not registered')

  event.recipes.example.heat_press()
    .id('example:scoped_heat_press')
    .slotName('hot_side', r => r.inputs(heat, 500))
    .perTick(r => r.inputFE(20))
    .chance(0.25, r => r.outputItems('minecraft:diamond'))
})

Diagnosing “recipe never starts” ​

  1. Confirm the capability exists in MBDRegistries.RECIPE_CAPABILITIES.
  2. Confirm the machine has a trait returning a handler for that exact capability instance.
  3. Confirm trait recipe handler IO supports the recipe direction.
  4. If slotName is set, confirm the handler advertises it.
  5. Simulate the requested amount against current storage and filters.
  6. Check conditions separately; a handler shortage and condition failure are different errors.

Released under the MIT License.