跳转至

Drop Item For

文档版本:1.21.0.24

Allows the entity to move toward a target, and drop an item near the target. This goal requires a "minecraft:navigation" to execute.

架构

drop_item_for:
{
  priority "priority"
  speed_multiplier "speed_multiplier"
  entity_types "entity_types"
  number "cooldown" : opt
  number "drop_item_chance" : opt
  number "goal_radius" : opt
  string "loot_table" : opt
  number "max_head_look_at_height" : opt
  number "minimum_teleport_distance" : opt
  number "offering_distance" : opt
  trigger "on_drop_attempt"
  integer "search_count" : opt
  integer "search_height" : opt
  integer "search_range" : opt
  number "seconds_before_pickup" : opt
  vector_of_3_items "target_range"
  vector_of_3_items "teleport_offset"
  range_number_type "time_of_day_range"
}
prioritypriority
priority:
integer
speed_multiplierspeed_multiplier
speed_multiplier:
number
entity_typesentity_types
The list of conditions another entity must meet to be a valid target to drop an item for.
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
}
cooldownnumber
Total time that the goal is on cooldown before it can be used again.
drop_item_chancenumber
The percent chance the entity will drop an item when using this goal.
goal_radiusnumber
Distance in blocks within the entity considers it has reached it's target position.
loot_tablestring
The loot table that contains the possible loot the entity can drop with this goal.
max_head_look_at_heightnumber
The maximum height the entities head will look at when dropping the item. The entity will always be looking at its target.
minimum_teleport_distancenumber
If the target position is farther away than this distance on any tick, the entity will teleport to the target position.
offering_distancenumber
The preferred distance the entity tries to be from the target it is dropping an item for.
on_drop_attempttrigger
The event to trigger when the entity attempts to drop an item.
trigger:
string
trigger:
{
  string "event" : opt
  filters "filters"
  subject "target"
}
eventstring
The event to run when the conditions for this trigger are met.
filtersfilters
一个过滤器组。The list of conditions for this trigger to execute.
targetsubject
The target of the event.
subject:
string
trigger:
array
{
  object "<any array element>" : opt
  {
    string "event" : opt
    filters "filters"
    subject "target"
  }
}
<any array element>object
<any array element>
search_countinteger
The number of blocks each tick that the entity will check within its search range and height for a valid block to move to. A value of 0 will have the mob check every block within range in one tick.
search_heightinteger
The Height in blocks the entity will search within to find a valid target position.
search_rangeinteger
The distance in blocks the entity will search within to find a valid target position.
seconds_before_pickupnumber
The numbers of seconds that will pass before the dropped entity can be picked up from the ground.
target_rangevector_of_3_items
The range in blocks within which the entity searches to find a target to drop an item for.
vector_of_3_items:
array
{
  number "0..0" : opt
  number "1..1" : opt
  number "2..2" : opt
}
0..0number
The X component.
1..1number
The Y component.
2..2number
The Z component.
teleport_offsetvector_of_3_items
When the entity teleports, offset the teleport position by this many blocks in the X, Y, and Z coordinate.
time_of_day_rangerange_number_type
The valid times of day that this goal can be used. For reference: noon is 0.0, sunset is 0.25, midnight is 0.5, and sunrise is 0.75, and back to noon for 1.0.
range_number_type:
number
range_number_type:
array
{
  number "0..0" : opt
  number "1..1" : opt
}
0..0number
The first value of the range.
1..1number
The second value of the range.
range_number_type:
{
  number "range_min" : opt
  number "range_max" : opt
}
range_minnumber
The minimum value of the range.
range_maxnumber
The maximum value of the range.