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

minecraft:looked_at

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

概览

minecraft:looked_at 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 当另一个实体(通常是玩家)直视这个实体时触发事件。末影人就用它在被盯着看时发怒。

字段

字段类型默认值说明
field_of_viewDecimal"26"用来判断是否有人在看的视锥宽度,单位为度。
filtersMinecraft Filter无哪些实体会被当作可能的观看者来检查。
find_players_onlyBoolean"false"只检查通过过滤器的最近玩家。
line_of_sight_obstruction_typeString"collision"哪种方块形状会遮挡视线:"outline"、"collision" 或 "collision_for_camera"。
look_at_locationsList无实体身上要测试的点;至少有一个可见才算。
looked_at_cooldownRange [a, b]"[0, 0]"被看到后再次检查前的随机等待秒数。
looked_at_eventString无有人看着实体时触发的事件。
min_looked_at_durationDecimal"0"对方必须持续看多少秒才算数。
not_looked_at_eventString无没人看着实体时触发的事件。
scale_fov_by_distanceBoolean"true"观看者越远视锥越窄,使它在实体处的宽度大致不变。
search_radiusDecimal"10"搜索观看者的距离(以方块计)。
set_targetBoolean"once_and_stop_scanning"观看者是否成为攻击目标:"never"、"once_and_stop_scanning" 或 "once_and_keep_scanning"。

示例

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

BP/entities/<name>.json
{
  "minecraft:looked_at": {
    "field_of_view": "26",
    "filters": {},
    "find_players_only": "false",
    "line_of_sight_obstruction_type": "collision",
    "look_at_locations": {},
    "looked_at_cooldown": "[0, 0]",
    "looked_at_event": "",
    "min_looked_at_duration": "0"
  }
}

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