JsonEM (Json Entity Models)
面向 modders、资源包制作人员 和 整合包制作人员 的库,用于使用 JSON 创建和编辑实体模型
不支持 OptiFine 格式!
生成参考实体模型:
如果您想导出所有实体模型的 JSON 版本(原版或模组添加的),以便通过资源包轻松编辑它们或将其用作示例,请按以下步骤操作:
- 启动游戏,然后打开位于
.minecraft/config/jsonem.properties的配置文件。 - 将文件的第二行修改为
dump_models=true。 - 重新启动游戏。导航至文件夹
.minecraft/jsonem_dump。 - 在该文件夹中,您应该能找到以资源包格式导出的所有已注册实体模型的 JSON 文件。
- 在使用资源包编辑或添加模型时,请使用此格式。
在 Blockbench 中编辑模型:
要在 Blockbench 中编辑模型,请安装本仓库中的插件。
- 从该 GitHub 仓库 下载 文件
jsonem_models.js - 在 Blockbench 中,导航至
File > Plugins,并在对话框顶部点击Load Plugin from File图标。选择jsonem_models.js文件。 - 导航至
File > New并选择JsonEM Java Entity Model开始编辑。 - 您也可以使用
File > Open Model导入 JsonEM JSON 模型文件,例如从游戏中导出的那些。 - 要导出供 JsonEM 使用的模型,请导航至
File > Export > Export JsonEM Java Entity Model并保存文件。
面向资源包/整合包制作人员:
- 完成上述步骤以导出您游戏或整合包中的所有实体模型。
- 在编辑您的资源包/整合包资源时,按照导出模型文件夹中的格式添加实体模型 JSON 文件。
面向 Modder:
JsonEM 可用于完全使用 JSON 为您的实体创建 TexturedModelData。
本指南将演示如何使用 JSON 制作 this tutorial 中 cube entity 的模型。
- 按以下方式包含模组(版本可在 此处 找到):
repositories {
maven { url "https://api.modrinth.com/maven" }
}
dependencies {
// 将 <version> 替换为所需的版本
modImplementation "maven.modrinth:jsonem:<version>"
include "maven.modrinth:jsonem:<version>"
}
- 通过 JsonEM 而不是 Fabric API 为您的实体注册实体模型层(无需代码生成的 TexturedModelData)
void onInitializeClient() {
[...]
JsonEM.registerModelLayer(MODEL_CUBE_LAYER); // Layer ID: "entitytesting:cube", Layer name: "main"
}
- 在您的模组资源中添加一个包含实体模型数据的模型文件
例如:assets/entitytesting/models/entity/cube/main.json
{
"texture": {
"width": 64,
"height": 64
},
"bones": {
"cube": {
"transform": {
"origin": [0, 0, 0]
},
"cuboids": [
{
"uv": [0, 0],
"offset": [-6, 12, -6],
"dimensions": [12, 12, 12]
}
]
}
}
}
- 确保在上述文件中,骨骼
"cube"在您实体的模型中使用相同的名称进行访问
public CubeEntityModel(ModelPart modelPart) {
this.base = modelPart.getChild("cube"); // 原始教程使用了名为 EntityModelPartNames.CUBE 的未指定字段
}
JsonEM (Json Entity Models)
Library for modders, resource pack makers, and modpack makers to create and edit entity models WITH JSON
Does not work with OptiFine format!
Generate Reference Entity Models:
If you'd like to dump json versions of all entity models (vanilla or modded) so that you can edit them easily with resource packs or use them as examples, here's how:
- Launch the game, and then open the configuration file located at
.minecraft/config/jsonem.properties. - Edit the second line of the file to be
dump_models=true. - Re-launch the game. Navigate to the folder
.minecraft/jsonem_dump. - Within this folder you should find all registered entity models dumped as json, formatted like a resource pack.
- Use this format when editing or adding models with a resource pack.
Edit Models in Blockbench:
To edit models in Blockbench, install the plugin located in this repository.
- Download the file
jsonem_models.jsfrom this GitHub repository - In Blockbench, navigate to
File > Plugins, and at the top of the dialog click the icon forLoad Plugin from File. Choose thejsonem_models.jsfile. - Navigate to
File > Newand chooseJsonEM Java Entity Modelto begin editing. - You can also
File > Open Modelto import a JsonEM json model file, such as those dumped from the game. - To export your model for use with JsonEM, navigate to
File > Export > Export JsonEM Java Entity Modeland save the file.
For Resource Pack/Modpack Makers:
- Complete the steps above to dump all entity models from your game or modpack.
- When editing your resource pack/modpack resources, add entity model json files as they are formatted in the dumped model folder.
For Modders:
JsonEM can be used to create TexturedModelData for your entities entirely using json.
This guide will demonstrate how to make the model for the cube entity in this tutorial with json.
- Include the mod as follows (versions can be found here):
repositories {
maven { url "https://api.modrinth.com/maven" }
}
dependencies {
// Replace <version> with desired version
modImplementation "maven.modrinth:jsonem:<version>"
include "maven.modrinth:jsonem:<version>"
}
- Register the entity model layer for your entity through JsonEM instead of Fabric API (Excludes the need for a code-generated TexturedModelData)
void onInitializeClient() {
[...]
JsonEM.registerModelLayer(MODEL_CUBE_LAYER); // Layer ID: "entitytesting:cube", Layer name: "main"
}
- Add a model file to your mod resources containing your entity's model data
EX:assets/entitytesting/models/entity/cube/main.json
{
"texture": {
"width": 64,
"height": 64
},
"bones": {
"cube": {
"transform": {
"origin": [0, 0, 0]
},
"cuboids": [
{
"uv": [0, 0],
"offset": [-6, 12, -6],
"dimensions": [12, 12, 12]
}
]
}
}
}
- Make sure that the bone
"cube"in the file above is being accessed with the same name in your entity model
public CubeEntityModel(ModelPart modelPart) {
this.base = modelPart.getChild("cube"); // The original tutorial used an unspecified field called EntityModelPartNames.CUBE
}
下载 JsonEM
下载 JsonEM
下载 JsonEM
下载 JsonEM
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonEM
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonEM
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonEM
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonEM
下载 JsonEM
下载 JsonEM
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- 更新到 26.1.1
- 对于开发者:用于注册模型层的辅助函数已被移除,如果资源包中存在模型 JSON 文件,模型层将自动添加
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
评论 0
登录后参与评分
还没有评论,来抢沙发吧