编辑

Entity Documentation - minecraft:behavior.move_towards_target

Allows mob to move towards its current target.

Note

Requires a target in order to work properly. Entities can generate targets via one of the following behaviors:

Entity Move Towards Target Behavior Properties

Name Default Value Type Description Example Values
control_flags [] Control Flags choices
priority 0 Integer number As priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal. Iron Golem: 2
speed_multiplier 1 Decimal number Movement speed multiplier of the mob when using this AI Goal Iron Golem: 0.9
within_radius 0 Decimal number Defines the radius in blocks that the mob tries to be from the target. A value of 0 means it tries to occupy the same block as the target Iron Golem: 32

Control Flags choices

Value Title Description
jump Jump
look Look
move Move

Samples

Iron Golem

"minecraft:behavior.move_towards_target": {
  "priority": 2,
  "speed_multiplier": 0.9,
  "within_radius": 32
}