Predicate Custom Models
一个客户端模组,允许通过资源包基于条件替换内置模型和实体模型。这并非用于更换物品栏中的物品模型(使用默认资源包即可实现该功能)。本模组旨在在原版系统之上构建,为服务器上的玩家提供完全可选的更多自定义选项。
它适用于诸如更改手中三叉戟的外观,或基于 NBT 标签拥有自定义头盔模型等场景。
目前处于早期 Alpha 阶段,选项有限,但基本框架已具备,并将不断扩展。
灵感来源于 Optifine 的自定义实体模型,并参考了 Fabric CEM,但两者并不兼容。
我决定采用自己的模型格式并编写自己的系统来处理条件判断。
使用方法:
- 在你的资源包中创建一个名为
assets/robotmonkey/cem 的文件夹。在这个文件夹内放置包含条件的文件。
- 在上述文件夹中创建一个名为
entityname.rem 的文件(例如 trident.rem)。在此文件中定义条件和每个条件所指向的模型。请查看 GitHub 上的示例文件。
- 创建一个文件夹来存放你的自定义模型,例如
assets/minecraft/models/custom。你可以随意命名此文件夹,只要上面的条件引用指向该位置即可。
- 在此处添加你的模型文件。目前没有简便的方法来创建这些模型,我一直手动从 Blockbench 导出的模型中进行制作。如果有人愿意帮助开发一个 Blockbench 插件,请联系我。
- 创建一个文件夹来存放你的自定义纹理,例如
assets/minecraft/textures/item。
- 在上述文件夹中添加你的模型所引用的纹理。
- 重新加载资源包,如果上述步骤操作正确,你现在应该已经拥有了自定义模型。
示例:
查看这个 resource pack 以获取一些示例。
当前支持的功能
- 手中的三叉戟模型
- 世界中的三叉戟模型(存在限制,详见下方)
- 铁/金/钻石/下界合金头盔。
限制:
据我所知,三叉戟被投掷后,其 NBT 数据不会同步到客户端。因此,如果你想让世界中的三叉戟渲染效果与普通三叉戟不同,可用的条件非常有限。
例如,使用 CustomModelData NBT 标签,你可以在手持时拥有多个具有不同模型的三叉戟,但一旦将其投掷出去,你必须指定“所有者是你的用户名”这一条件,并在你投掷它时将其渲染为特定模型。
兼容性
目前我无法保证与其他模组的兼容性。我尽量以不会引起问题的方式编写此模组,但任何改变渲染方式的模组可能会不兼容。
如果遇到任何具体问题,请在 GitHub 上提交 Issue,我会进行调查。
待办事项
- 添加更多护甲部件
- 这需要确保每个部件都有正确的命名组,以便随身体移动。
- 考虑其他实体。
- 编写一个 Blockbench 插件以将模型导出为自定义格式。
- 优化模型创建
- 目前每个条件都会创建一个模型。如果多个条件引用同一个模型,它将被多次构建和存储。
- 基于 Identifier 建立条件注册表,允许引用已创建的模型。
- 创建 Wiki,列出可检查的可能条件及示例。
Predicate Custom Models
A client side mod to enable swapping of built-in models and entity models based on conditions using a resource pack. This is not a replacement for changing item models in your inventory, that is possible using default resource packs. This is meant to build on top of the vanilla systems and add more customizations completely optional of the people on a server.
This is meant as an option for things such as changing out how your trident looks in hand or having a custom helmet model based on an NBT tag.
This is in early alpha stages with limited options, but the basic premise is here and will be expanded on.
The idea comes from Optifines custom entity models and took reference from Fabric CEM but these are not compatible.
I decided to take my own model formats and write my own system to handle conditions.
How to:
- In your resource pack, make a folder for
assets/robotmonkey/cem Inside this folder is where you will put your file that contain conditions.
- Create a file inside the above folder called
entityname.rem (eg. trident.rem) inside here you will have some conditions and the models that each condition points to. Check the example file on the GitHub
- Create a folder to hold your custom models e.g.
assets/minecraft/models/custom. You can call this folder whatever you want, as long as your conditions reference above point there.
- In here add your model files. Right now there is no easy way to create these, I have been hand making them my self from exports of Blockbench models. If someone would like to help create a Blockbench plugin please reach out.
- Create a folder to hold your custom textures e.g.
assets/minecraft/textures/item.
- In the above folder add your textures that your models reference.
- Reload your resource pack and as long as the above was done correctly you should now have your custom models.
Example:
Check out this resource pack for some examples
Currently Supported
- Trident Models in Hand
- Trident Models in world (With limitations, check below)
- Iron/Gold/Diamond/Netherite helmets.
Limitations:
Currently, as far as I can tell, the NBT data of a trident is not synced to clients once it has been thrown. So, if you want to render a trident in the world differently than a normal trident there is limited conditions to change how it looks.
As an example, using the NBT tag for CustomModelData you can have multiple tridents with different models while you are holding them, but once you throw them, you have to assign a condition for the Owner being your username and have it render as a specific model if you threw it.
Compatibility
I cannot guarantee compatibility with other mods as of right now. I am trying to write this in a way such that it should not cause any issues, but any mods that change how things render might be incompatible.
If you encounter any specific issues, please open an issue on the GitHub and I will look into it.
TODO
- Add more armor pieces
- This involves making sure that each piece has their proper named groups for making them move with the body.
- Consider other entities.
- Write a plugin for Blockbench to export the models to the custom format.
- Optimize model creation
- Right now each condition creates a model. If multiple conditions reference the same model it will be built and stored multiple times.
- Having a registry of conditions based on the Identifier will allow for reference to already created models.
- Create Wiki with possible conditions to be checked and examples.
评论 0
登录后参与评分
还没有评论,来抢沙发吧