概览
minecraft:buoyant 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让实体像船一样漂浮在水等液体表面,还可以让它随波起伏。
字段
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
apply_gravity | Boolean | "true" | 每刻都把实体往下拉,这会让波浪运动更明显,但离开液体时也会下落得更猛。 |
base_buoyancy | Decimal | "1.0" | 实体向上浮的力度,数值越大浮得越高。 |
big_wave_probability | Decimal | "0.03" | 大浪打到实体的概率,仅在 "waves" 运动类型下使用。 |
big_wave_speed | Decimal | "10.0" | 大浪的速度倍数。 |
can_auto_step_from_liquid | Boolean | "false" | 实体被推到旁边的固体方块时,可以从液体中爬上去。 |
drag_down_on_buoyancy_removed | Decimal | "0.0" | 移除这个组件时实体被往下拉的力度。 |
liquid_blocks | List | 无 | 实体可以漂浮在上面的液体方块。 |
movement_type | String | "waves" | 上下起伏的方式:"waves"、"bobbing" 或 "none"。 |
示例
写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):
BP/entities/<name>.json
{
"minecraft:buoyant": {
"apply_gravity": "true",
"base_buoyancy": "1.0",
"big_wave_probability": "0.03",
"big_wave_speed": "10.0",
"can_auto_step_from_liquid": "false",
"drag_down_on_buoyancy_removed": "0.0",
"liquid_blocks": {},
"movement_type": "waves"
}
}