自定义实体
自定义实体是minecraft1.12.02beta中的新增内容,可以修改原版实体的部分特性及增加一个全新的实体。
行为包
首先,你需要一个可用的模板,然后在于manifest.json同层的地方,新建一个entities的文件夹,在文件夹中放入你新增的实体的json。
{
"format_version": "1.8.0",
"minecraft:entity": {
"description": {
"identifier": "test:npc",
"runtime_identifier": "test:npc",
"is_spawnable": true,
"is_summonable": true,
"is_experimental": false
},
"components": {
"minecraft:fire_immune": true,
"minecraft:type_family": {
"family": [ "test", "npc"]
}
}
}
}
自定义的实体json与其他生物实体json的写法相同,具体可参照行为包教程。
材质包
同样需要一个可用的模板包。在与manifest.json同层的地方,创建一个entity的文件夹,将实体的属性json写进去,写法可参照原版的实体json。如:
{
"format_version": "1.8.0",
"minecraft:client_entity": {
"description": {
"identifier": "test:npc",
"materials": { "default": "npc" },
"textures": {
"default": "textures/entity/npc"
},
"geometry": {
"default":"geometry.npc"
},
"render_controllers": [
"controller.render.npc"
],
"spawn_egg": {
"base_color": "#99e550",
"overlay_color": "#99e550"
}
}
}
}
identifier与之前行为包中所写ID需统一,materials决定了将被调用的materials。texturs后面为实体贴图材质路径,geometry则确定了实体的建模文件路径,render_controllers则决定了这个实体所拥有的动作。两个color则分别确定了生成这个实体的蛋的定色与底色,格式为十六进制。