= 创作分享 =
编程开发
为什么我照Wiki写的CoT脚本不起作用
cxim_晨夕·星海

为什么我照Wiki写的CoT脚本不起作用

cxim_晨夕·星海 于 2024-1-16 09:39 ( 3月前 ) [复制链接] [只看楼主] [打印]
153 1
  1. #loader contenttweaker
  2. #modloaded tconstruct
  3. import mods.contenttweaker.tconstruct.Material;
  4. import mods.contenttweaker.tconstruct.MaterialBuilder;
  5. import mods.contenttweaker.tconstruct.Trait;
  6. import mods.contenttweaker.tconstruct.TraitBuilder;

  7. function rgb(r as int, g as int, b as int) as int{
  8.     return (r % 256 * 0x010000) + (g % 256 * 0x000100) + (b % 256);
  9. };


  10. // Why can't we use dirt to make tools?
  11. val dirt_color = rgb(150, 108, 74);
  12. val m_dirt as MaterialBuilder = MaterialBuilder.create("dirt");
  13.     m_dirt.color = dirt_color;
  14.     m_dirt.craftable = true;
  15.     m_dirt.castable = false;
  16.     m_dirt.addItem(<item:minecraft:dirt>);
  17.        
  18.     myMaterial.addMaterialTrait("cheap");
  19.        
  20.     m_dirt.addMaterialTrait("cheapskate", "head");
  21.     m_dirt.addHeadMaterialStats(3, 0.2, 0.2, 1);
  22.        
  23.     m_dirt.addMaterialTrait("cheapskate","handle");
  24.     m_dirt.addHandleMaterialStats(0.2, 3);
  25.        
  26.     m_dirt.addExtraMaterialStats(1);
  27.     m_dirt.addMaterialTrait("cheapskate", "bow");
  28.        
  29.     m_dirt..addBowMaterialStats(0.05, 5.0, 0.0);
  30.        
  31.     m_dirt.representativeItem = <minecraft:dirt>;
  32. m_dirt.register();
复制代码


发表于 2024-1-16 09:39:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

回复 | 举报

该帖共收到 1 条回复!
cxim_晨夕·星海
本帖最后由 cxim_ 于 2024-1-17 11:06 编辑

好吧,明白了,主要原因是多打了一个“.”和“;”
发表于 2024-1-17 11:00:49 | 只看该作者

回复 | 举报

百科目前不允许匿名发帖哦~ 请先 [ 登陆 ][ 注册 ] 吧~

本版积分规则

发新帖
  • 回复
  • 点评
  • 评分

[ MC百科(mcmod.cn) 除另有声明,所有开放公共编辑的内容均使用 BY-NC-SA 3.0 协议 ]

Minecraft百科CC协议
快速回复 返回顶部 返回列表