1. Wiki
  2. /实体
  3. /minecraft:physics

minecraft:physics

不想手写?在 GodCraft 里打开一个开关,就能帮你设置好 minecraft:physics。Get GodCraft

概览

minecraft:physics 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 开启或关闭实体的基础物理:下落和碰撞。漂浮的生物请把 has_gravity 设为 false。

字段

字段类型默认值说明
has_gravitybooleantrue为 true 时,实体没有支撑就会下落。
has_collisionbooleantrue为 true 时,实体会撞上方块而不是穿过去。
push_towards_closest_spacebooleanfalse为 true 时,卡在方块里的实体会被推到最近的空位。

示例

写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):

BP/entities/<name>.json
{
  "minecraft:physics": {
    "has_gravity": true,
    "has_collision": true,
    "push_towards_closest_space": false
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more