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

minecraft:entity_sensor

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

概览

minecraft:entity_sensor 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 监测附近的其他实体,当它们满足你的条件时触发事件。每个子传感器都有自己的范围和事件。

字段

字段类型默认值说明
find_players_onlyBoolean"false"所有子传感器都只查找玩家。
relative_rangeBoolean"true"把实体自身的大小加到每个子传感器的范围上。
subsensorsList无传感器列表,每个都包含范围、条件和要触发的事件。

示例

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

BP/entities/<name>.json
{
  "minecraft:entity_sensor": {
    "find_players_only": "false",
    "relative_range": "true",
    "subsensors": {}
  }
}

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