NeoGeckoJS

模组

· 作者 MrClockwork

现在,在 NeoForge 上可以使用 KubeJS 通过 GeckoLib 创建可动画化的方块/物品/护甲!

0 本站下载 0 关注 更新于 5 个月前

需要前置:KubeJS、Geckolib

最新 1.0.1 · 1.21.1 · NeoForge

一键开服(送7天)

Gecko JS

只需使用 KubeJS,即可利用 GeckoLib 创建可动画化的方块/物品/盔甲!

本模组最初是为 Forge 1.20.1 制作的,当时没有 Modrinth 版本。不过,此版本对模组进行了移植和更新,以适配 NeoForge 1.21.1,并实现了近乎完美的 1:1 复制,因此任何原始脚本和资源几乎都能以相同的方式工作!

有哪些示例?

所有原始示例都应能几乎完全一样地工作,毕竟这几乎是 1:1 的移植。

启动脚本:

StartupEvents.registry("block", event => {

    const rotating = RawAnimation.begin().thenLoop("rotating");

    event.create("geckojs:example_block", "animatable")
        .box(1, 1, 1, 15, 15, 15, true)
        .animatableBlockEntity(blockEntity => {

            blockEntity.addController(state => state.setAndContinue(rotating))

        })
        .defaultGeoModel()
})

物品示例:

StartupEvents.registry('item', event => {
    event.create('cool_sword', 'anim_sword')
        .tier('diamond')
        .defaultGeoModel()
        .addController(controller => {
            controller.addAnimation(state => {
                if (state.isMoving()) {
                    return state.setAndContinue(RawAnimation.begin().thenLoop("walk"))
                }
                return state.setAndContinue(RawAnimation.begin().thenLoop("idle"))
            })
        })
})

盔甲示例:

event.create('fancy_helmet', 'anim_helmet')
    .material('iron')
    .defaultGeoModel()
    .armorItemUseGeoModel() // 使物品图标使用 3D 模型
    .boneVisibility((renderer, slot) => {
        // 隐藏盔甲模型上的特定骨骼
        renderer.hideBone("extra_antenna") 
    })

方块示例:

StartupEvents.registry('block', event => {
    event.create('animated_pillar', 'animatable')
        .defaultGeoModel()
        .addController(controller => {
            controller.addAnimation(state => {
                return state.setAndContinue(RawAnimation.begin().thenLoop("spin"))
            })
        })
})

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源