本篇教程由作者设定未经允许禁止转载。

这个教程将教你如何使用Lychee进行简单的世界合成,大多数为示范代码,可能有些不清楚请多谅解,如果你想为此教程做出贡献可以写在评论区(审核不让我投社区教程)

本教程对于所有人采用CC0进行许可,默认授予任何人权利



本模组有两种使用方法,一种是使用数据包添加合成,另一种是使用CrT等魔改工具添加合成,因为我不会制作数据包,所以只讲后面那种

CrT:

//原生
recipes.addJsonRecipe("recipe_name",{ 
    somethings JSON
});
//使用库LycheeTweaker(Github上搜)
LycheeRecipeManager.addRecipe("recipe_name", <recipetype:lychee:[recipe_type]>, new LycheeRecipeBuilder()
    .action1()
    .action2()
);

KubeJS:

event.custom({
  sonethings JSON
})

将物体投入方块中合成另外一种方块

实例:尘土丢入水变成粘土

//CrT:
recipes.addJsonRecipe("clay_watter",{ 
    type:"lychee:item_inside",
    item_in: { item: "exnihilosequentia:dust" },
    block_in: { blocks: ["minecraft:water"] },
    post:  {  type: "drop_item",  item: "minecraft:clay"}
});

//CrT库
LycheeRecipeManager.addRecipe("clay_watter", <recipetype:lychee:item_inside>, new LycheeRecipeBuilder()
    .itemIn(<item:exnihilosequentia:dust>)
    .blockIn(<block:minecraft:water>)
    .post(LycheePosts.dropItem(<item:minecraft:clay>))
);

//KubeJS
event.custom({
    "type":"lychee:item_inside",
    "item_in": { "item": "exnihilosequentia:dust" },
    "block_in": { "blocks": ["minecraft:water"] },
    "post":  {  "type": "drop_item",  "item": "minecraft:clay"}
})

物品点击方块后产生物品

实例:木剑打石头变成木棍

//CrT:
recipes.addJsonRecipe("stone_sword",{ 
    type:"lychee:block_clicking",
    item_in: { item: "minecraft:wooden_sword" },
    block_in: { blocks: ["minecraft:stone"] },
    post:  {  type: "drop_item",  item: "minecraft:stick"}
});

//CrT库
LycheeRecipeManager.addRecipe("clay_watter", <recipetype:lychee:block_clicking>, new LycheeRecipeBuilder()
    .itemIn(<item:minecraft:wooden_sword>)
    .blockIn(<block:minecraft:stoner>)
    .post(LycheePosts.dropItem(<item:minecraft:stick>))
);

//KubeJS
event.custom({
    "type":"lychee:block_clicking",
    "item_in": { "item": "minecraft:wooden_sword" },
    "block_in": { "blocks": ["block:minecraft:stoner"] },
    "post":  {  "type": "drop_item",  "item": "item:minecraft:stick"}
})