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

本教程适用于匠魂2(1.12.2),cot版本不限


本教程代码部分标点符号全为英文的标点符号


※本教程的代码会汇总放在最后,如果只是需要代码可以直接跳过前面的解释,直接去最后实例复制,且本教程适用于匠魂盔甲,原版可以使用但不推荐


必写内容带有“☆”


☆第一步:导包

对了,再导包之前还要做一件事

#loader contenttweaker

这一步的意思是使用cot来加载这个zs脚本,这一步非常非常的重要,如果不写默认是crt加载,是会出问题的,最后不可以加分号,会报错的

然后是导包的代码,我也不太清楚为什么要导这些包,某神秘大佬教的

import crafttweaker.liquid.ILiquidStack;

import crafttweaker.game.IGame;


import mods.contenttweaker.tconstruct.Material;

import mods.contenttweaker.tconstruct.MaterialBuilder;

import mods.contenttweaker.Fluid;

import mods.contenttweaker.VanillaFactory;

import mods.contenttweaker.Color;

import mods.contenttweaker.conarm.ExtendedMaterialBuilder;


第二步:创建一个名为yunxi的匠魂材料,并设置一些基本数据

小提示:这个是可以构建匠魂盔甲的,如果不需要可以查看这个

☆创建一个ID为yunxi的:

val yunxi = ExtendedMaterialBuilder.create("yunxi");

※此处只能修改yunxi,其他的不得修改,yunxi就是你的匠魂材料的ID了,一个ID只能是“数字”、“英文”或者“_”,且不能重复

☆发现没有颜色?试试加上这个吧

yunxi.color = 0xffeb3b;

※yunxi是你要注册的ID.color = 0x十六进制颜色代码;

冶炼炉制作

yunxi.castable = true;

※“=”后面可以写false或者true

部件部件台

yunxi.craftable = true;

※“=”后面可以写false或者true

匠魂宝典显示的物品,我这里是面包

yunxi.representativeItem = <item:minecraft:bread>;

※“=”后面是<item:物品ID>

冶炼炉需要的流体,我这里是岩浆,如果只是部件加工台可以不用写

yunxi.liquid = <liquid:lava>;

部件加工台需要的物品,我这里是面包,如果只是冶炼炉可以不用写

☆yunxi.addItem(<item:minecraft:bread>);

☆※书中显示图标,括号里是<item:物品ID>,我这里是面包

☆yunxi.localizedName = "面包";

☆※本地化名称,我这里是面包,貌似还有一种方法,不太清楚,可以去这里看看

☆第三步:给材料设置基本属性

☆实例:yunxi.addHeadMaterialStats(200, 3.5, 3, 0);

☆※具体方法:yunxi.add部件名称MaterialStats(数值);

该材料可以制作顶端,具体属性为200的耐久,3.5的挖掘速度,3的攻击力,0的挖掘等级(石头)

部件ID和括号里填写的数值如下

顶端(Head):耐久-挖掘速度-攻击力-挖掘等级

手柄(Handle):手柄系数-耐久

其他部件(Extra):耐久

弓臂(Bow):拉弓速度(某神秘大佬说匠魂宝典的数值*这个数值=1)-范围系数-附加伤害

箭头(Projectile):括号里不能写东西

弓弦(BowString):强化

箭羽(Fletching):强化-精准度

基底(Core):耐久-护甲

护甲板(Plates):强化-耐久-韧性

夹板(Trim):耐久

发现没有特性?

不要着急马上就讲

实例:yunxi.addMaterialTrait("fractured", "head");

※该ID为yunxi的头部部件添加一个ID为fractured的特性

方法如下:

yunxi.addMaterialTrait("特性id", "部件名");

※部件名不写就是给所有的部件加这个特性

※一个部件如果要拥有多个特性就需要多写几个addMaterialTrait

※题外话:有的时候cot不识别某些特性可以使用匠魂调整,详情可以看看这个教程的评论区。

☆第四步:注册

方法如下:

yunxi.register();

你的ID.register();

※括号里不能写东西

代码部分:

#loader contenttweaker

import crafttweaker.liquid.ILiquidStack;
import crafttweaker.game.IGame;
import mods.contenttweaker.tconstruct.Material;
import mods.contenttweaker.tconstruct.MaterialBuilder;
import mods.contenttweaker.Fluid;
import mods.contenttweaker.VanillaFactory;
import mods.contenttweaker.Color;
import mods.contenttweaker.conarm.ExtendedMaterialBuilder;

val yunxi = ExtendedMaterialBuilder.create("yunxi");
yunxi.color = 0xffeb3b;
yunxi.castable = true;
yunxi.craftable = true;
yunxi.representativeItem = <item:minecraft:bread>;
yunxi.liquid = <liquid:lava>;
yunxi.addItem(<item:minecraft:bread>);
yunxi.localizedName = "面包";
yunxi.addHeadMaterialStats(200, 3.5, 3, 0);
yunxi.addHandleMaterialStats(0.2, 70);
yunxi.addExtraMaterialStats(-30);
yunxi.addBowMaterialStats(2.2, 1, 0.2);
yunxi.addProjectileMaterialStats();
yunxi.addBowStringMaterialStats(2.25);
yunxi.addFletchingMaterialStats(1.0, 2.5);
yunxi.addCoreMaterialStats(80, 4);
yunxi.addPlatesMaterialStats(0.25, 10, 0.25);
yunxi.addTrimMaterialStats(20);
yunxi.addMaterialTrait("blasting", "bowstring");
yunxi.addMaterialTrait("blasting", "head");
yunxi.addMaterialTrait("fractured", "head");
yunxi.addMaterialTrait("dense");
yunxi.register();

好了现在重启游戏吧,怕出错可以先输入/ct syntax指令,如果没有报错就重启游戏,如果有仔细查看是不是和我写的一样,如果无法解决,可以在评论区发代码和日志。


什么?你说用冶炼炉锻造无法获得流体怎么办?


那你就去看看这个教程吧。