Skip to content

Anvil Recipes ​

Anvil recipes allow custom anvil crafting behavior with experience cost and component copying support.

YAML Example ​

yaml
type: 'anvil'
result: 'minecraft:diamond_sword'
base: 'minecraft:iron_sword'
addition: 'minecraft:diamond'
cost_level: 3
copy_components_rules:
  - 'enchantments'
  - 'display_name'
  - 'lore'

Fields ​

FieldTypeRequiredDescription
typestringYesMust be anvil
resultstringYesOutput item ID
basestringYesLeft anvil slot item (base item)
additionstringYesRight anvil slot item (addition ingredient)
cost_levelintegerNoExperience levels consumed, default 0
copy_components_ruleslistNoComponent copy rules (see Smithing Recipes)
fake_result_previewstringNoFake preview item shown during crafting

Difference from Vanilla Anvil ​

  • Vanilla anvil: item repair, enchantment combining, renaming
  • Custom anvil recipes: fully custom input → output mapping, bypassing vanilla logic

Enable / Disable ​

Anvil recipe functionality can be globally controlled in config.yml:

yaml
enable_anvil_recipe: true

Set to false to disable all custom anvil recipes.

Copy Components Rules ​

Note: It is recommended to use the new result_processors configuration option, which provides more powerful features. The old copy_components_rules syntax is still compatible. See Result Processors.

Same as smithing recipes. See Smithing Recipes — Copy Components Rules for the full list of supported rules.

Notes ​

  • Both base and addition support item packs (item_pack:) and item tags (tag:)
  • Anvil recipes support ingredient amounts, e.g. tag:minecraft:planks 4 requires 4 of every item in the tag. Item packs also support this, e.g. item_pack:all_wood 4
  • The amount suffix is only valid in anvil recipes; ingredients of other recipe types do not support amounts
  • cost_level of 0 means no experience is consumed
  • When multiple anvil recipes match the same input, the first matching recipe is used

基于 GPL-3.0 许可证发布