本篇教程由作者设定使用 CC BY-NC 协议。
题外话:这个令人迷惑的wiki
首先要明确这个脚本文件是属于对配方的修改因此我们要将脚本文件放置于kubejs/sever_scripts中。
其次这个脚本文件的格式应该是这样的:
onEvent('recipes', e => {
e.custom({
"type": "compactcrafting:miniaturization",
"recipeSize": 3,
"layers":[
{"type": "compactcrafting:mixed","pattern": [
["A", "A", "A"],["A", "A", "A"],["A", "A", "A"]]},
{"type": "compactcrafting:mixed","pattern": [
["A", "A", "A"],["A", "A", "A"],["A", "A", "A"]]},
{"type": "compactcrafting:mixed","pattern": [
["A", "A", "A"],["A", "A", "A"],["A", "A", "A"]]}],
"catalyst": {"id": '',"Count": },
"components": {
"A": {"type": "compactcrafting:block","block": ''},
},
"outputs": [{"id": '',"Count": }]})
})
以下是对各个变量的解释:
Type(type)
就是配方的类型,既然是对CC的教程那么应该必须是:
compactcrafting:miniaturization
RecipeSize(recipeSize)
这个决定了你的配方的大小,最好是使用奇数,例如3,5,7etc,比如你设置为3,那么在游戏里的多方块结构就应该是3*3*3的大小。同理设置为9,就对应9*9*9.
Layers(layers)
这个用于决定你的配方中的多方块结构的每一层的物品组成,这个层数取决与你在RecipeSize中填的数字,填的3就要写三层,其他同理,有三种定义方式:
compactcrafting:filled
compactcrafting:hollow
compactcrafting:mixed
filled表示这一层只由一种材料(即下面的C)组成,形状为■,示例:
"layers":[{
"type": "compactcrafting:filled",
"component": "C"
}]
hollow表示这一层只由一种材料(即下面的C)组成,形状为回,示例:
"layers":[{
"type": "compactcrafting:hollow",
"wall": "C"
}]
mixed表示这一层有多种材料(即下面的C,D,E)混合组成,示例:
"layers":{[
"type": "compactcrafting:mixed",
"pattern": [
["C", "C", "C", "C", "C"],
["C", "E", "E", "E", "C"],
["C", "E", "D", "E", "C"],
["C", "E", "E", "E", "C"],
["C", "C", "C", "C", "C"]
]}
每一层的类型都要为一样的,不然/reload时会出错(至少我是会出错),建议都使用mixed类型
Catalyst
即催化剂,其意义为在合成时摆放了正确的多方快结构时启动微缩力场投影仪进行合成,示例:
"catalyst": {"id": 'minecraft:iron_ingot',"Count": 4}
Components
和其他魔改脚本的key的用法一样,用于对layes中的key进行定义,示例:
"components": {
"C": {
"type": "compactcrafting:block",
"block": "minecraft:coal_block"
}
}
Output
即配方的输出结果(注意Count的大小写),示例:
"output":[{
"id": "minecraft:diamond_block",
"Count": 27
}]
教程就这些了,如有指教请指出,谢谢