概览
minecraft:physics 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 开启或关闭实体的基础物理:下落和碰撞。漂浮的生物请把 has_gravity 设为 false。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
has_gravity | boolean | true | 为 true 时,实体没有支撑就会下落。 |
has_collision | boolean | true | 为 true 时,实体会撞上方块而不是穿过去。 |
push_towards_closest_space | boolean | false | 为 true 时,卡在方块里的实体会被推到最近的空位。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:physics": {
"has_gravity": true,
"has_collision": true,
"push_towards_closest_space": false
}
}