Random Look Around¶
文档版本:1.21.50.25
Allows this entity to locate a random target block that it can path find to. Once found, the entity will move towards it and dig up an item.
架构¶
random_search_and_dig:
{
priority "priority"
speed_multiplier "speed_multiplier"
vector_of_2_items "cooldown_range"
number "cooldown_range" : opt
vector_of_2_items "digging_duration_range"
number "find_valid_position_retries" : opt
number "goal_radius" : opt
string "item_table" : opt
trigger "on_digging_start"
trigger "on_fail_during_digging"
trigger "on_fail_during_searching"
trigger "on_item_found"
trigger "on_searching_start"
trigger "on_success"
number "search_range_xz" : opt
number "search_range_y" : opt
number "spawn_item_after_seconds" : opt
number "spawn_item_pos_offset" : opt
array "target_blocks" : opt
{
reference "<any array element>"
}
number "target_dig_position_offset" : opt
}
priority:priority
speed_multiplier:speed_multiplier
cooldown_range:vector_of_2_items- Goal cooldown range in seconds.
0..0:number- The X component.
1..1:number- The Y component.
cooldown_range:number- Goal cooldown range in seconds.
digging_duration_range:vector_of_2_items- Digging duration in seconds.
find_valid_position_retries:number- Amount of retries to find a valid target position within search range.
goal_radius:number- Distance in blocks within the entity to considers it has reached it's target position.
item_table:string- File path relative to the behavior pack root for items to spawn list (loot table format).
on_digging_start:trigger- Event to run when the goal ends searching has begins digging.
event:string- The event to run when the conditions for this trigger are met.
filters:filters- 一个过滤器组。The list of conditions for this trigger to execute.
target:subject- The target of the event.
trigger:
array
{
object "<any array element>" : opt
{
string "event" : opt
filters "filters"
subject "target"
}
}
<any array element>:object
<any array element>on_fail_during_digging:trigger- Event to run when the goal failed while in digging state.
on_fail_during_searching:trigger- Event to run when the goal failed while in searching state.
on_item_found:trigger- Event to run when the goal find a item.
on_searching_start:trigger- Event to run when the goal starts searching.
on_success:trigger- Event to run when searching and digging has ended.
search_range_xz:number- Width and length of the volume around the entity used to find a valid target position
search_range_y:number- Height of the volume around the entity used to find a valid target position
spawn_item_after_seconds:number- Digging duration before spawning item in seconds.
spawn_item_pos_offset:number- Distance to offset the item's spawn location in the direction the mob is facing.
target_blocks:array- List of target block types the goal will look to dig on. Overrides the default list.
target_blocks<any array element>:reference
reference:
{
identifier "name"
object "states" : opt
{
['boolean', 'integer', 'string'] "\w*:?\w+" : opt
}
0 "tags"
}
name:identifier
states:object
states\w*:?\w+:['boolean', 'integer', 'string']- The key of property is the name of the block state/property, the value must be the same as the block properties accepted values.
tags:0- A condition using Molang queries that results to true/false that can be used to query for blocks with certain tags.
target_dig_position_offset:number- Dig target position offset from the feet position of the mob in their facing direction.