-
Notifications
You must be signed in to change notification settings - Fork 0
Custom Resource Pack
Kaleidoscope ImmersiveEating 会从资源包中读取模型、动画、定义、音频和材质。一个最小的示例包位于仓库根目录的 example_resourcepack 文件夹。
example_resourcepack/
├── pack.mcmeta
└── assets/
└── food/
├── animations/
│ └── example_item.animation.json
├── definitions/
│ └── example_item.json
├── geo/
│ └── example_item.geo.json
├── sounds/
│ └── example_eating.ogg
├── sounds.json
└── textures/
└── item/
└── example_item.png
这五个目录是必须的:
-
animations:GeckoLib 动画文件。 -
definitions:物品 ID、隐藏 bone 和声音映射。 -
geo:GeckoLib 模型文件。 -
sounds:音频文件。 -
textures:材质目录。当前模组读取物品材质的路径是textures/item。
pack.meta 不是 Minecraft 资源包元数据文件。正确文件名是 pack.mcmeta。
定义、模型、动画和材质需要共用同一个前缀。例如:
definitions/example_item.json
geo/example_item.geo.json
animations/example_item.animation.json
textures/item/example_item.png
.geo.json 和 .animation.json 是特殊后缀,不需要把完整文件名互相复制,但它们的前缀 example_item 必须一致。
音频文件名由声音 ID 的路径决定:
sounds/example_eating.ogg
对应定义中的:
"eating": "food:example_eating"这里的 eating 必须与动画文件中的声音关键帧名称一致:
"sound_effects": {
"1.85": {
"effect": "eating"
}
}完整格式如下:
{
"item": "modid:example_item",
"invisible": [
"some_bone"
],
"sounds": {
"SoundKeyFrameName": "food:SoundName"
}
}要替换渲染的物品注册 ID,格式为:
命名空间:物品路径
示例中的 modid:example_item 只是占位符,必须改成实际存在的物品 ID。物品路径建议全部使用小写字母、数字和下划线。
列出待机阶段需要隐藏的 bone 名称。示例中的 kuaizi 必须存在于 example_item.geo.json 的 bones 中;如果 bone 不存在,配置不会达到预期效果。
隐藏某个父 bone 时,它的子 bone 也会一起隐藏。进食动画播放期间,模组会恢复这些模型部分。
将动画中的声音关键帧名称映射到声音事件:
"sounds": {
"eating": "food:example_eating"
}左侧 eating 对应动画中的 effect,右侧 food:example_eating 对应 assets/food/sounds/example_eating.ogg。
动画文件中必须存在名为 eat 的动画:
{
"animations": {
"eat": {}
}
}动画时间线末尾需要加入 finished 指令:
"timeline": {
"12.0": "finished;"
}没有这个指令时,模组无法正常执行进食动画结束后的收尾逻辑。
- 将
example_resourcepack文件夹复制到 Minecraft 的resourcepacks目录,或压缩成 ZIP 后放入该目录。 - 打开
assets/food/definitions/example_item.json。 - 把
modid:example_item替换成真实的物品 ID。 - 确认模型中的 bone 名称与
invisible配置一致。 - 在游戏资源包列表中启用资源包。
示例包中的模型、动画、材质和音频是用于演示结构的占位资源;真正制作内容时,可以直接替换这些文件,但需要保留对应的命名规则。