minecraft:behavior.take_block
Allows the entity to take a block from the world and carry it around.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
blocks | List of object or text | [] | Block descriptors for which blocks are valid to be taken by the entity, if empty all blocks are valid. |
can_take | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filters for if the entity should try to take a block. Self and Target are set. |
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_take | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Trigger ran if the entity does take a block. Self, Target, and Block are set. |
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. |
xz_range | Object | {"max": 2, "min": -2} | XZ range from which the entity will try and take blocks from. |
min | Integer | 0 | |
max | Integer | 0 | |
y_range | Object | {"max": 3, "min": 0} | Y range from which the entity will try and take blocks from. |
min | Integer | 0 | |
max | Integer | 0 | |
chance | Decimal0 to 1 | 1 | Chance each tick for the entity to try and take a block. |
affected_by_griefing_rule | Boolean | true | If true, whether the goal is affected by the mob griefing game rule. |
requires_line_of_sight | Boolean | true | If true, whether the entity needs line of sight to the block they are trying to take. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Enderman uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.take_block": {
"priority": 11,
"xz_range": {
"min": -2,
"max": 2
},
"y_range": {
"min": 0,
"max": 3
},
"chance": 0.05,
"blocks": [
"dirt",
"grass_block",
"podzol",
"coarse_dirt",
"mycelium",
"dirt_with_roots",
"moss_block",
"pale_moss_block",
"muddy_mangrove_roots",
"mud",
"sand",
"red_sand",
"gravel",
"brown_mushroom",
"red_mushroom",
"tnt",
"cactus",
"cactus_flower",
"clay",
"pumpkin",
"carved_pumpkin",
"melon_block",
"crimson_fungus",
"crimson_nylium",
"crimson_roots",
"warped_fungus",
"warped_nylium",
"warped_roots",
"dandelion",
"open_eyeblossom",
"closed_eyeblossom",
"poppy",
"blue_orchid",
"allium",
"azure_bluet",
"red_tulip",
"orange_tulip",
"white_tulip",
"pink_tulip",
"oxeye_daisy",
"cornflower",
"lily_of_the_valley",
"wither_rose",
"torchflower",
"golden_dandelion"
]
}
}Used by 1
Vanilla entities with minecraft:behavior.take_block in their definition:
Related components
behavior.pickup_itemsbehavior.move_to_villagebehavior.harvest_farm_blockbehavior.lay_eggbehavior.move_indoorsbehavior.move_outdoorsbehavior.place_blockbehavior.raid_gardenbehavior.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.transport_items