
KubeJS Mystical Agriculture
KubeJS 扩展,支持所有神秘农业配方类型,并可创建生物灵魂与作物。无需进行神秘定制。
KubeJS 神秘农业
该项目有两个目标:替代神秘定制,并为所有神秘农业配方类型添加支持。
通过此项目,你可以添加觉醒配方、附魔台配方、灌注配方、种子再处理配方、灵魂提取配方和 Soulium 生成器配方。
此模组具有针对作物和生物灵魂类型的启动事件,允许访问相应的注册表,这意味着你可以添加作物和生物灵魂。
添加配方
ServerEvents.recipes(event => {
const {awakening,enchanter,infusion,reprocessor,soul_extraction,soulium_spawner} = event.recipes.mysticalagriculture;
// 觉醒
awakening(
"minecraft:gold_ingot", // 结果
"minecraft:iron_ingot", // 中间物品
[
Item.of("minecraft:yellow_dye",40), // 可包含数量
Item.of("minecraft:yellow_dye",40),
Item.of("minecraft:yellow_dye",40),
Item.of("minecraft:yellow_dye",40)
], // 精华容器中的物品
[
"#minecraft;flowers",
"#minecraft;flowers",
"#minecraft;flowers",
"#minecraft;flowers",
] // 基座上的物品
);
// 附魔台
enchanter(
"minecraft:sharpness", // 将产生的附魔结果
[
Item.of("minecraft:flint",3),
Item.of("minecraft:iron_ingot",2)
] // 1-2 个物品的数组,可包含数量
);
// 灌注
infusion(
"minecraft:emerald", // 结果
"minecraft:diamond", // 中间物品
[
Item.of("minecraft:green_dye",4) // 数量被展开为多个物品
] // 基座上的物品
);
// 再处理
reprocessor(
"minecraft:iron_ingot", // 结果
"minecraft:compass" // 输入物品
);
// 灵魂提取器
// 构造器 1
soul_extraction(
{
type:"mysticalagriculture:blaze",
souls:30
}, // 生物灵魂
"minecraft:magma_cream" // 输入物品
);
// 构造器 2
soul_extraction(
"mysticalagriculture:zombie", // 生物灵魂类型
0.5, //灵魂数量
"minecraft:diamond" // 输入物品
);
// Soulium 生成器
soulium_spawner(
[
{
entity:"minecraft:zombie",
weight:100
},
{
entity:"minecraft:iron_golem",
// 如果未定义权重,默认为 1
}
], // 实体
[
Item.of("minecraft:emerald",4) // 可包含数量
] // 输入物品
);
});
添加作物
在 startup_scripts 中
MysticalAgricultureStartupEvents.crop(event => {
// 在此处你可以通过 event.registry 访问作物注册表
/* 方法
void register(Crop crop);
void registerTier(CropTier tier);
void registerType(CropType type);
List<Crop> getCrops();
Crop getCropById(ResourceLocation id);
Crop getCropByName(String name);
List<CropTier> getTiers();
CropTier getTierById(ResourceLocation id);
List<CropType> getTypes();
CropType getTypeById(ResourceLocation id);
*/
// 注意,你无法注销作物,但可以禁用它们。
// 要注册作物,你需要一个 Crop 对象。
const kubium = new Crop(
"kubejs:kubium", // 作物 ID
"mysticalagriculture:5", // 作物等级 ID 或对象
"mysticalagriculture:resource", // 作物类型 ID 或对象
new CropTextures(
"mysticalagriculture:block/flower_ingot",// 花朵纹理
"mysticalagriculture:item/essence_ingot" // 精华纹理
// 你也可以通过传递额外参数为种子设置纹理。
), // 纹理
"#forge:ingots/kubium" // 材料,请注意这是神秘农业使用的自定义对象,因此必须是标签或物品。
);
const red = new Crop(
"kubejs:red",
CropTier.ONE,
CropType.RESOURCE,
CropTextures.DUST_CROP_TEXTURES,
16711680,// 十进制颜色
"minecraft:red_dye"
);
// 创建作物后注册它们。
event.register(kubium);
red.setDisplayName(Text.ofString("RED").red());
event.register(red);
});
项目矩阵房间:https://matrix.to/#/!JWjgXbzJNbNspnvzKJ:matrix.org?via=matrix.org
正在加载版本记录…
正在加载评论…
评论在新手盒子客户端中发表,这里同步展示。