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
}
cause
:string- The type of damage that is applied to entities that enter the damage range.
damage_cooldown
:number- Attack cooldown (in seconds) for how often this entity can attack a target.
damage_per_tick
:integer- How much damage per tick is applied to entities that enter the damage range.
damage_range
:number- How close a hostile entity must be to have the damage applied.
entity_filter
:entity_filters- The set of entities that are valid to apply the damage to when within range.
any_of
:sub_filter
sub_filter:
{
string "test" : opt
string "subject" : opt
string "operator" : opt
string "value" : opt
}
test
:string
subject
:string
operator
:string
value
:string
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>
test
:string
subject
:string
operator
:string
value
:string
all_of
:sub_filter
none_of
:sub_filter
play_attack_sound
:boolean- If the entity should play their attack sound when attacking a target.