第五步:
编写物体的属性和数据:
打开 YYYmod/entities/decoration/xxx/xxx.json 复制粘贴这段代码
{
"type" : "entity",
"mixins" : "file(xxx_ghost.json)",
"components": {
"stonehearth:entity_forms" : {
"iconic_form" : "file(xxx_iconic.json)",
"ghost_form" : "file(xxx_ghost.json)",
"placeable_on_ground" : true
},
"region_collision_shape" : {
"region": [
{
"min" : { "x" : -1, "y" : 0, "z" : 0 },
"max" : { "x" : 2, "y" : 2, "z" : 1 }
}
]
}
},
"entity_data" : {
"stonehearth:net_worth" : {
"value_in_gold" : 50,
"rarity" : "common",
"shop_info" : {
"buyable" : true,
"sellable" : true,
"shopkeeper_level" : 1,
"shopkeeper_type" : "caravan"
}
}
}
}
注释:
1."type" 物体的类型,entity是实体
2."mixins" : "file(xxx_ghost.json)" 意思是该物体混入到某个属性里,不用管.
3."stonehearth:entity_forms" 这里是设置物体在仓库时和虚影时分别的模型,
"iconic_form"是物体在仓库时的模型,"ghost_form"是物体虚影时的模型.后面的是相应的路径.
"placeable_on_ground" : true,表示该物体可以放在地方,"placeable_on_wall" 是在墙上,可以替换
4."region_collision_shape"设置模型的碰撞体,x y z 数据自己填,要看自己的模型大小来调.
5."entity_data" 实体数据,"value_in_gold" 价值是多少."rarity" : "common" 稀有程度:普通.
6."shop_info" 商店设置;"buyable"是否可以购买,"sellable"是否可以出售.