跳到正文

KubeJS ComputerCraft

作者:Amygdaloideae

通过 KubeJS 添加 ComputerCraft 外设

收藏

介绍

介绍由机器翻译自 CurseForge 原页面,仅供参考。

为 KubeJS 添加支持,以便向任意方块添加 外围设备。

 

支持 Forge 和 Fabric(请查看文件 选项卡,因为“最近文件”只会 显示最新条目)

 

示例:

 

在 startup_scripts 中:

 

onEvent(“computercraft.peripheral”, event => {
    event.registerPeripheral(“furnace”, “furnace”)
        //This limits the method to 1 tick/call,
        //as the method is scheduled on main thread.
        .mainThreadMethod(“burnTime”, (container, direction, arguments) => {
            return container.entityData.getInt(“BurnTime”)
        })
        //This has no limit on calling,
        //however, the method can’t access most of the in-world data.
        //For example, accessing the NBT of a tile entity
        .method(“say_hi”, (container, direction, arguments) => {
            container.up.set(“diamond_block”)
            return “hi, here’s your diamond block”
        })
})
 

常见问题

KubeJS ComputerCraft 支持哪些 Minecraft 版本?

KubeJS ComputerCraft 支持 Minecraft Java 版 1.18.2,可用的加载器:Fabric / Forge。下载时注意选择和你游戏版本一致的文件。

KubeJS ComputerCraft 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

Amygdaloideae 的其他作品

查看全部 →