minecraft:behavior.raid_garden
Allows the mob to eat/raid crops out of farms until they are full.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
max_to_eat | Integer | 6 | Maximum number of crops this entity wants to eat/raid. If set to zero or less then it doesn't have a maximum |
full_delay | Integermin 0 | 100 | Amount of time in seconds before this mob wants to eat/raid again after eating its maximum |
eat_delay | Integermin 0 | 2 | Time in seconds between each time it eats/raids |
initial_eat_delay | Integermin 0 | 0 | Time in seconds before starting to eat/raid once it arrives at it |
blocks | List of text | [] | Blocks that the mob is looking for to eat/raid |
search_range | Integer | 0 | Distance in blocks the mob will look for crops to eat |
search_height | Integer | 1 | Height in blocks the mob will look for crops to eat |
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. |
speed_multiplier | Decimalmin 0 | 1 | Movement speed multiplier of the mob when using this goal. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Fox uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.raid_garden": {
"priority": 12,
"blocks": [
"minecraft:sweet_berry_bush",
"minecraft:cave_vines_head_with_berries",
"minecraft:cave_vines_body_with_berries"
],
"speed_multiplier": 1.2,
"search_range": 12,
"search_height": 2,
"goal_radius": 0.8,
"max_to_eat": 0,
"initial_eat_delay": 2
}
}Used by 2
Vanilla entities with minecraft:behavior.raid_garden in their definition:
Related components
behavior.pickup_itemsbehavior.move_to_villagebehavior.harvest_farm_blockbehavior.lay_eggbehavior.move_indoorsbehavior.move_outdoorsbehavior.place_blockbehavior.digbehavior.dragonscanningbehavior.drop_item_forbehavior.eat_blockbehavior.eat_carried_itembehavior.eat_mobbehavior.fertilize_farm_blockbehavior.hold_groundbehavior.inspect_bookshelfbehavior.move_through_villagebehavior.open_doorbehavior.random_search_and_digbehavior.restrict_open_doorbehavior.snackingbehavior.stroll_towards_villagebehavior.take_blockbehavior.transport_items