Entity Sensor¶
文档版本:1.21.50.25
A component that fires an event when a set of conditions are met by other entities within the defined range.
架构¶
entity_sensor:
{
number "cooldown" : opt
filters "event_filters"
string "event" : opt
integer "maximum_count" : opt
integer "minimum_count" : opt
vector_of_2_items "range"
number "range" : opt
boolean "require_all" : opt
number "sensor_range" : opt
}
cooldown:number- How many seconds should elapse before the subsensor can once again sense for entities. The cooldown is applied on top of the base 1 tick (0.05 seconds) delay. Negative values will result in no cooldown being used.
event_filters:filters- 一个过滤器组。
event:string- event.
maximum_count:integer- The maximum number of entities that must pass the filter conditions for the event to send.
minimum_count:integer- The minimum number of entities that must pass the filter conditions for the event to send.
range:vector_of_2_items- The maximum distance another entity can be from this and have the filters checked against it.
0..0:number- The X component.
1..1:number- The Y component.
range:number- The maximum distance another entity can be from this and have the filters checked against it.
require_all:boolean- If true requires all nearby entities to pass the filter conditions for the event to send.
sensor_range:number- The maximum distance another entity can be from this and have the filters checked against it.
relative_range:boolean- If true the sensor range is additive on top of the entity's size.
entity_sensor:
{
array "subsensors" : opt
{
object "<any array element>" : opt
{
number "cooldown" : opt
filters "event_filters"
string "event" : opt
integer "maximum_count" : opt
integer "minimum_count" : opt
vector_of_2_items "range"
number "range" : opt
boolean "require_all" : opt
number "sensor_range" : opt
}
}
boolean "relative_range" : opt
}
subsensors:array- The list of subsensors.
subsensors<any array element>:object
<any array element>relative_range:boolean- If true the sensor range is additive on top of the entity's size.