概览
minecraft:home 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 把实体的生成位置记为它的家,并可以防止它走得太远。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
restriction_type | restriction_type | "none" | "none" 表示不限制,"random_movement" 让随机游荡保持在家附近,"all_movement" 让所有移动都保持在家附近。 |
restriction_radius | integer | 0 | 实体离家最远可以移动多少格。 |
home_block_list | string[] | 无 | 算作有效家的方块;如果方块没了,限制就会解除。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:home": {
"restriction_type": "none",
"restriction_radius": 0,
"home_block_list": []
}
}