# 18.1 熔炼之镐

***

本示例是对添加配方和Loot Table修改的综合运用

效果：使用下界合金镐挖掘方块时，矿石和石头类的方块会被自动熔炼

```
//代码块 1
onEvent('recipes', event => {
  event.shapeless(Item.of('minecraft:netherite_pickaxe', {furnaceSmelt:"true"}), [Item.of('minecraft:netherite_pickaxe').ignoreNBT(), 'minecraft:lava_bucket']).replaceIngredient('minecraft:lava_bucket', 'minecraft:bucket')
})
//代码块 2
onEvent('block.loot_tables', event => {  
  event.modifyBlock(/minecraft:.*_ore/, table => {
    table.furnaceSmelt()
    table.addCondition({"condition": "minecraft:alternative","terms": [{"condition": "minecraft:match_tool","predicate": {"nbt": "{id:'furnaceSmelt'}"}}]})
  })
  event.modifyBlock(/minecraft:.*stone/, table => {
    table.furnaceSmelt()
    table.addCondition({"condition": "minecraft:alternative","terms": [{"condition": "minecraft:match_tool","predicate": {"nbt": "{id:'furnaceSmelt'}"}}]})
  })
})
```

代码块1中使用了 2.1配方的添加中的nbt合成 和 11.3非标准配方修改中的替换输入物品

代码块2中使用了 4自定义loot table和其addCondition的写法(即原版json格式)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wudji.gitbook.io/xplus-kubejs-tutorial-v1-zh_cn/others/smelting-pickaxe.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
