跳转至

Target Nearby Sensor

文档版本:1.21.0.24

Defines the entity's range within which it can see or sense other entities to target them.

架构

target_nearby_sensor:
{
  boolean "must_see" : opt
  number "inside_range" : opt
  event_object "on_inside_range"
  event_object "on_outside_range"
  event_object "on_vision_lost_inside_range"
  number "outside_range" : opt
}
must_seeboolean
Whether the other entity needs to be visible to trigger inside events.
inside_rangenumber
Maximum distance in blocks that another entity will be considered in the inside range.
on_inside_rangeevent_object
Event to call when an entity gets in the inside range. Can specify event for the name of the event and target for the target of the event
event_object:
{
  filters "filters"
  string "event" : opt
  string "target" : opt
}
filtersfilters
一个过滤器组
eventstring
The event to fire.
targetstring
The target of the event.
on_outside_rangeevent_object
Event to call when an entity gets in the outside range. Can specify event for the name of the event and target for the target of the event
on_vision_lost_inside_rangeevent_object
Event to call when an entity exits visual range. Can specify event for the name of the event and target for the target of the event
outside_rangenumber
Maximum distance in blocks that another entity will be considered in the outside range.