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 material)
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

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:)
  • 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 许可证发布