minecraft:behavior.place_block
Allows the entity to place a block.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
placeable_carried_blocks | List of object or text | [] | Block descriptors for which blocks are valid to be placed from the entity's carried item, if empty all blocks are valid. |
randomly_placeable_blocks | List of object | [] | Weighted block descriptors for which blocks should be randomly placed, if empty the entity will try to place its carried block from placeable_carried_blocks. |
block | Object or Text | {"name": "", "states": {}, "tags": ""} | Block descriptor for this entry. |
name | Text | "" | |
tags | Text | "" | |
states | Object | — | |
filter | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filter for if this entry should be randomly selected from. Self, Target, and Block 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. |
weight | Integer | 1 | Weight for this entry. |
can_place | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filters for if the entity should try to place its 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_place | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Trigger ran if the entity does place its 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 place blocks in. |
min | Integer | 0 | |
max | Integer | 0 | |
y_range | Object | {"max": 3, "min": 0} | Y range from which the entity will try and place blocks in. |
min | Integer | 0 | |
max | Integer | 0 | |
chance | Decimal0 to 1 | 1 | Chance each tick for the entity to try and place a block. |
affected_by_griefing_rule | Boolean | true | If true, whether the goal is affected by the mob griefing game rule. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Copper Golem uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.place_block": {
"affected_by_griefing_rule": false,
"randomly_placeable_blocks": [
{
"block": {
"name": "minecraft:oxidized_copper_golem_statue",
"states": {
"minecraft:cardinal_direction": "north"
}
},
"filter": {
"any_of": [
{
"all_of": [
{
"operator": ">=",
"test": "y_rotation",
"value": 135
},
{
"operator": "<",
"test": "y_rotation",
"value": 180
}
]
},
{
"all_of": [
{
"operator": ">=",
"test": "y_rotation",
"value": -180
},
{
"operator": "<",
"test": "y_rotation",
"value": -135
}
]
}
]
}
},
{
"block": {
"name": "minecraft:oxidized_copper_golem_statue",
"states": {
"minecraft:cardinal_direction": "east"
}
},
"filter": {
"all_of": [
{
"operator": ">=",
"test": "y_rotation",
"value": -135
},
{
"operator": "<",
"test": "y_rotation",
"value": -45
}
]
}
},
{
"block": {
"name": "minecraft:oxidized_copper_golem_statue",
"states": {
"minecraft:cardinal_direction": "south"
}
},
"filter": {
"all_of": [
{
"operator": ">=",
"test": "y_rotation",
"value": -45
},
{
"operator": "<",
"test": "y_rotation",
"value": 45
}
]
}
},
{
"block": {
"name": "minecraft:oxidized_copper_golem_statue",
"states": {
"minecraft:cardinal_direction": "west"
}
},
"filter": {
"all_of": [
{
"operator": ">=",
"test": "y_rotation",
"value": 45
},
{
"operator": "<",
"test": "y_rotation",
"value": 135
}
]
}
}
],
"can_place": {
"domain": "minecraft:is_becoming_statue",
"test": "bool_property",
"value": false
},
"chance": 0.0058,
"priority": 1,
"on_place": {
"event": "minecraft:become_statue",
"target": "self"
},
"xz_range": 0,
"y_range": 0
}
}Used by 2
Vanilla entities with minecraft:behavior.place_block in their definition:
Related components
behavior.pickup_itemsbehavior.move_to_villagebehavior.harvest_farm_blockbehavior.lay_eggbehavior.move_indoorsbehavior.move_outdoorsbehavior.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.take_blockbehavior.transport_items