跳转至

minecraft:area_attack

文档版本:1.21.0.24

A component that does damage to entities that get within range.

架构

minecraft:area_attack:
{
  string "cause" : opt
  number "damage_cooldown" : opt
  integer "damage_per_tick" : opt
  number "damage_range" : opt
  entity_filters "entity_filter"
  boolean "play_attack_sound" : opt
}
causestring
The type of damage that is applied to entities that enter the damage range.
damage_cooldownnumber
Attack cooldown (in seconds) for how often this entity can attack a target.
damage_per_tickinteger
How much damage per tick is applied to entities that enter the damage range.
damage_rangenumber
How close a hostile entity must be to have the damage applied.
entity_filterentity_filters
The set of entities that are valid to apply the damage to when within range.
entity_filters:
{
  sub_filter "any_of"
  sub_filter "all_of"
  sub_filter "none_of"
}
any_ofsub_filter
sub_filter:
{
  string "test" : opt
  string "subject" : opt
  string "operator" : opt
  string "value" : opt
}
teststring
subjectstring
operatorstring
valuestring
sub_filter:
array
{
  object "<any array element>" : opt
  {
    string "test" : opt
    string "subject" : opt
    string "operator" : opt
    string "value" : opt
  }
}
<any array element>object
<any array element>
teststring
subjectstring
operatorstring
valuestring
all_ofsub_filter
none_ofsub_filter
play_attack_soundboolean
If the entity should play their attack sound when attacking a target.