minecraft:behavior.place_block

Allows the entity to place a block.

Properties

PropertyTypeDefaultWhat it does
placeable_carried_blocksList 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_blocksList 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.
blockObject or Text{"name": "", "states": {}, "tags": ""}Block descriptor for this entry.
nameText""
tagsText""
statesObject—
filterObject 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.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
weightInteger1Weight for this entry.
can_placeObject 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.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
on_placeObject{"event": "", "filters": {"AND": null, "NOT": null, "OR":…Trigger ran if the entity does place its block. Self, Target, and Block are set.
eventText""
targetTextself, other, player, target, parent, baby, block, damager, holder, item"self"
filtersObject 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.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
xz_rangeObject{"max": 2, "min": -2}XZ range from which the entity will try and place blocks in.
minInteger0
maxInteger0
y_rangeObject{"max": 3, "min": 0}Y range from which the entity will try and place blocks in.
minInteger0
maxInteger0
chanceDecimal0 to 11Chance each tick for the entity to try and place a block.
affected_by_griefing_ruleBooleantrueIf true, whether the goal is affected by the mob griefing game rule.
priorityIntegermin 00
control_flagsList 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