Gecko JS
使用 GeckoLib 通过 KubeJS 创建可动画化的方块/物品/盔甲
简单示例
启动脚本
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.addAnimation(state => state.setAndContinue(rotating))
})
.defaultGeoModel()
})
模型 assets/geckojs/geo/block/example_block.geo.json
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.example_block",
"texture_width": 48,
"texture_height": 48,
"visible_bounds_width": 3,
"visible_bounds_height": 2.5,
"visible_bounds_offset": [0, 0.75, 0]
},
"bones": [
{
"name": "bone",
"pivot": [0, 8, 0],
"cubes": [
{
"origin": [-7, 1, -7],
"size": [14, 14, 14],
"uv": {
"north": {"uv": [0, 0], "uv_size": [14, 14]},
"east": {"uv": [0, 14], "uv_size": [14, 14]},
"south": {"uv": [14, 0], "uv_size": [14, 14]},
"west": {"uv": [14, 14], "uv_size": [14, 14]},
"up": {"uv": [0, 28], "uv_size": [14, 14]},
"down": {"uv": [28, 14], "uv_size": [14, -14]}
}
}
]
}
]
}
]
}
动画 assets/geckojs/animations/block/example_block.animations.json
{
"format_version": "1.8.0",
"animations": {
"rotating": {
"loop": true,
"animation_length": 3,
"bones": {
"bone": {
"rotation": {
"vector": ["Math.sin(query.anim_time*90)*180", "Math.cos(query.anim_time*90)*180", "Math.sin(query.anim_time*90)*180"]
}
}
}
}
},
"geckolib_format_version": 2
}
纹理 assets/geckojs/textures/block/example_block.png

你是这个资源的作者?登录后可认领此资源。
相似资源
玉Jade ?
Snownee
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
实用前置
339
KubeJS
Lat
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
前置实用
239
物品管理器Just Enough Items (JEI)
mezz
查看物品与配方
前置实用
239
Xaero的小地图
thexaero
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
冒险交通
238
Applied Energistics 2
shartte
AE2:一款流行的自动化与存储模组
存储科技
217
WTHIT
deirn
那是什么?一个 Waila/Hwyla 的分支。
前置实用
165
评论 0
登录后参与评分
还没有评论,来抢沙发吧