ContentTweaker是CraftTweaker的扩展,允许使用ZenScript自定义物品、方块、流体、创造标签以及更多内容!
由于ContentTweaker脚本加载的特殊性,包含ContentTweaker的脚本需要和其他脚本独立于一个特殊的文件,且开头为#loader contenttweaker
官方示例的一个脚本:
#loader contenttweaker
import mods.contenttweaker.VanillaFactory;
import mods.contenttweaker.Block;
var zsBlock = VanillaFactory.createBlock("zs_block", <blockmaterial:iron>);
zsBlock.fullBlock = true;
zsBlock.lightOpacity = 255;
zsBlock.translucent = true;
zsBlock.lightValue = 1.0;
zsBlock.blockHardness = 5.0;
zsBlock.blockResistance = 5.0;
zsBlock.toolClass = "pickaxe";
zsBlock.toolLevel = 2;
zsBlock.blockSoundType = <soundtype:metal>;
zsBlock.register();
1.16.5使用的脚本
#loader contenttweaker
import mods.contenttweaker.item.ItemBuilder;
// This is the simplest way to creating items
new ItemBuilder().build("generic_item");
new ItemBuilder().build("generic_item_2");
new ItemBuilder().build("generic_item_3");
1.16.5添加材质需要其他模组帮助(三选一即可):
Open Loader
The Loader
DRP - Global Data Pack