跳转至

Defend Trusted Target

文档版本:1.21.0.24

Allows the mob to target another mob that hurts an entity it trusts.

架构

defend_trusted_target:
{
  priority "priority"
  sound_event "aggro_sound"
  integer "attack_interval" : opt
  boolean "must_see" : opt
  number "must_see_forget_duration" : opt
  event "on_defend_start"
  number "within_radius" : opt
  entity_types "entity_types"
  number "sound_chance" : opt
}
prioritypriority
priority:
integer
aggro_soundsound_event
Sound to occasionally play while defending.
sound_event:
string
attack_intervalinteger
Time in seconds between attacks.
must_seeboolean
If true, only entities in this mob's viewing range can be selected as targets.
must_see_forget_durationnumber
Determines the amount of time in seconds that this mob will look for a target before forgetting about it and looking for a new one when the target isn't visible any more.
on_defend_startevent
The event to run when this mob starts to defend the entity it trusts.
event:
string
event:
{
  string "event" : opt
  string "target" : opt
}
eventstring
The event to fire.
targetstring
The target of the event.
within_radiusnumber
Distance in blocks that the target can be within to launch an attack.
entity_typesentity_types
List of entity types that this mob considers valid targets.
entity_types:
array
{
  object "<any array element>" : opt
  {
    filters "filters"
    number "cooldown" : opt
    number "max_dist" : opt
    number "max_height" : opt
    number "max_flee" : opt
    number "priority" : opt
    number "within_default" : opt
    boolean "check_if_outnumbered" : opt
    boolean "must_see" : opt
    number "must_see_forget_duration" : opt
    boolean "reevaluate_description" : opt
    number "sprint_speed_multiplier" : opt
    number "walk_speed_multiplier" : opt
  }
}
<any array element>object
The entity type.
<any array element>
filtersfilters
一个过滤器组
cooldownnumber
The amount of time in seconds that the mob has to wait before selecting a target of the same type again
max_distnumber
Maximum distance this mob can be away to be a valid choice.
max_heightnumber
UNDOCUMENTED.
max_fleenumber
UNDOCUMENTED.
prioritynumber
UNDOCUMENTED.
within_defaultnumber
UNDOCUMENTED.
check_if_outnumberedboolean
UNDOCUMENTED.
must_seeboolean
If true, the mob has to be visible to be a valid choice.
must_see_forget_durationnumber
Determines the amount of time in seconds that this mob will look for a target before forgetting about it and looking for a new one when the target isn't visible any more.
reevaluate_descriptionboolean
If true, the mob will stop being targeted if it stops meeting any conditions.
sprint_speed_multipliernumber
Multiplier for the running speed. A value of 1.0 means the speed is unchanged
walk_speed_multipliernumber
Multiplier for the walking speed. A value of 1.0 means the speed is unchanged
entity_types:
{
  filters "filters"
  number "cooldown" : opt
  number "max_dist" : opt
  number "max_height" : opt
  number "max_flee" : opt
  number "priority" : opt
  number "within_default" : opt
  boolean "check_if_outnumbered" : opt
  boolean "must_see" : opt
  number "must_see_forget_duration" : opt
  boolean "reevaluate_description" : opt
  number "sprint_speed_multiplier" : opt
  number "walk_speed_multiplier" : opt
}
sound_chancenumber
Probability that a sound will play.