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

minecraft:block_sensor

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

概览

minecraft:block_sensor 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 实体附近有列出的方块被破坏时触发一个事件。猪灵用它在有人破坏金块或箱子时发怒。

字段

字段类型默认值说明
on_breakList无要监视的方块列表,每个列表都带有方块被破坏时触发的事件。同一方块出现在多个列表中会触发多个事件。
sensor_radiusDecimal"16.00"能察觉到多远的方块被破坏。允许的最大值为 32。
sourcesList无用过滤器指定监听哪些破坏者。为空时任何方块被破坏都算。

示例

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

BP/entities/<name>.json
{
  "minecraft:block_sensor": {
    "on_break": {},
    "sensor_radius": "16.00",
    "sources": {}
  }
}

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