跳转至

Move To Block

文档版本:1.21.0.24

Allows mob to move towards a block.

架构

move_to_block:
{
  priority "priority"
  number "goal_radius" : opt
  trigger "on_stay_completed"
  trigger "on_reach"
  number "start_chance" : opt
  integer "search_range" : opt
  integer "search_height" : opt
  number "stay_duration" : opt
  string "target_selection_method" : opt
  array "target_offset" : opt
  {
    number "0..0" : opt
    number "1..1" : opt
    number "2..2" : opt
  }
  array "target_blocks" : opt
  {
    descriptor "<any array element>"
  }
  filters "target_block_filters"
  integer "tick_interval" : opt
}
prioritypriority
priority:
integer
goal_radiusnumber
Distance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot
on_stay_completedtrigger
Event to run on completing a stay of stay_duration at the block.
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>
on_reachtrigger
Event to run on block reached.
start_chancenumber
Chance to start the behavior (applied after each random tick_interval).
search_rangeinteger
The distance in blocks that the mob will look for the block.
search_heightinteger
The height in blocks that the mob will look for the block.
stay_durationnumber
Number of ticks needed to complete a stay at the block.
target_selection_methodstring
Kind of block to find fitting the specification. Valid values are "random" and "nearest".
target_offsetarray
Offset to add to the selected target position.
target_offset
0..0number
1..1number
2..2number
target_blocksarray
Block types to move to.
target_blocks
<any array element>descriptor
identifier:
string
descriptor:
{
  identifier "item"
  object "item" : opt
  {
  }
  0 "tags"
  string "item_tag" : opt
}
itemidentifier
itemobject
An object that describes an item.
item
tags0
[UNDOCUMENTED] A Molang expression ran against item or block to match.
0:
string
item_tagstring
[UNDOCUMENTED] A tag to lookup item or block by.
descriptor:
{
  identifier "item"
  object "item" : opt
  {
    identifier "item"
    object "item" : opt
    {
    }
    0 "tags"
    string "item_tag" : opt
  }
}
itemidentifier
itemobject
An object that describes an item.
item
target_block_filtersfilters
一个过滤器组。Filters to apply on the target blocks. Target blocks are only valid if the filters are true.
tick_intervalinteger
Average interval in ticks to try to run this behavior.