2.3 非标准配方修改
例子1:修改机械动力中粉碎轮的合成配方
event.custom({
type: 'create:crushing',//指定合成方式为粉碎轮
ingredients: [
Ingredient.of('minecraft:oak_sapling').toJson()//输入内容
],
results: [//这里的 results(包括所有类似的位置的双引号都是可加可不加的)
Item.of('minecraft:apple').toResultJson(),//100%输出苹果
Item.of('minecraft:carrot').withChance(0.5).toResultJson()//50%输出苹果
],
processingTime: 100 //所用时间
})
//若上述配方使用Json格式添加(即原版数据包格式)
{
"type": "create:crushing",
"ingredients": [
{
"tag": "minecraft:oak_sapling"
}
],
"results": [
{
"item": "minecraft:apple",
"count": 1
},
{
"item": "minecraft:carrot",
"chance": 0.5
}
],
"processingTime": 100
}例子2:为Extended Crafting添加配方
例子3:修改输入物品状态
功能
函数格式
内容
示例