minecraft:behavior.move_to_block
Allows mob to move towards a block.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
speed_multiplier | Decimal | 1 | Movement speed multiplier of the mob when using this AI Goal. |
search_range | Integer | 0 | The distance in blocks that the mob will look for the block. |
search_height | Integer | 1 | The height in blocks that the mob will look for the block. |
tick_interval | Integer | 20 | Average interval in ticks to try to run this behavior. |
stay_duration | Decimal | 0 | Number of ticks needed to complete a stay at the block. |
goal_radius | Decimal | 0.5 | 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. |
start_chance | Decimal | 1 | Chance to start the behavior (applied after each random tick_interval). |
target_selection_method | Textnearest, random | "nearest" | Kind of block to find fitting the specification. Valid values are "random" and "nearest". |
target_offset | List of decimal or Object | [0, 0, 0] | Offset to add to the selected target position. |
x | Decimal | 0 | |
y | Decimal | 0 | |
z | Decimal | 0 | |
on_reach | List of object | [] | Event to run on block reached. |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
on_stay_completed | List of object | [] | Event to run on completing a stay of stay_duration at the block. |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
target_blocks | List of text or object | [] | Block types to move to. |
target_block_filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Conditions that need to be met for a block to be a valid target. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Bee uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.move_to_block": {
"priority": 10,
"tick_interval": 1,
"start_chance": 0.5,
"search_range": 6,
"search_height": 4,
"goal_radius": 1.0,
"stay_duration": 20.0,
"target_selection_method": "random",
"target_offset": [
0,
0.25,
0
],
"target_block_filters": {
"test": "is_waterlogged",
"subject": "block",
"operator": "==",
"value": false
},
"target_blocks": [
"minecraft:poppy",
"minecraft:blue_orchid",
"minecraft:allium",
"minecraft:azure_bluet",
"minecraft:red_tulip",
"minecraft:orange_tulip",
"minecraft:white_tulip",
"minecraft:pink_tulip",
"minecraft:oxeye_daisy",
"minecraft:cornflower",
"minecraft:lily_of_the_valley",
"minecraft:dandelion",
"minecraft:wither_rose",
"minecraft:sunflower",
"minecraft:lilac",
"minecraft:rose_bush",
"minecraft:peony",
"minecraft:flowering_azalea",
"minecraft:azalea_leaves_flowered",
"minecraft:mangrove_propagule",
"minecraft:pitcher_plant",
"minecraft:torchflower",
"minecraft:cherry_leaves",
"minecraft:pink_petals",
"minecraft:open_eyeblossom",
"minecraft:wildflowers",
"minecraft:cactus_flower",
"minecraft:chorus_flower",
"minecraft:spore_blossom"
],
"on_stay_completed": [
{
"event": "collected_nectar",
"target": "self"
}
]
}
}Used by 1
Vanilla entities with minecraft:behavior.move_to_block in their definition:
Related components
behavior.floatbehavior.random_swimbehavior.swim_idlebehavior.swim_wanderbehavior.use_kinetic_weaponbehavior.move_to_waterbehavior.teleport_to_ownerbehavior.float_wanderbehavior.go_homebehavior.random_hoverbehavior.slime_floatbehavior.slime_keep_on_jumpingbehavior.slime_random_directionbehavior.move_to_landbehavior.move_to_random_blockbehavior.circle_around_anchorbehavior.dragonholdingpatternbehavior.dragonlandingbehavior.dragontakeoffbehavior.explore_outskirtsbehavior.find_underwater_treasurebehavior.move_to_liquidbehavior.random_breachbehavior.random_fly