1. Wiki
  2. /Entities
  3. /minecraft:behavior.place_block

minecraft:behavior.place_block

Don't want to write this by hand? GodCraft sets minecraft:behavior.place_block for you with a switch.Get GodCraft

Overview

minecraft:behavior.place_block is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets the entity place blocks in the world, either the block it carries or a random one from a weighted list. Endermen use it to put down the block they hold.

Fields

FieldTypeDefaultDescription
placeable_carried_blocksBlock Descriptor[]noneWhich carried blocks may be placed. Leave empty to allow any block.
randomly_placeable_blocksPlaceBlockGoalWeightedBlockDescriptor[]noneA weighted list of blocks to place at random. If empty, the entity places its carried block instead.
can_placeFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Conditions that must be true for the entity to try placing a block.
on_placeActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Event that runs after a block is placed.
xz_rangeIntRange{"max":2,"min":-2}Sideways range around the entity where blocks can be placed.
y_rangeIntRange{"max":3,"min":0}Up and down range around the entity where blocks can be placed.
chancenumber1Chance each tick that the entity tries to place a block.Range: 0 to 1
affected_by_griefing_rulebooleantrueIf true, the goal stops working when the mobGriefing game rule is off.
priorityinteger0Decides which goal wins when several want to run: lower numbers run first.Range: 0 to …
control_flagsGoal's control flags[]noneLists the body parts this goal takes control of (such as move, look or jump), so goals that need the same part don't run together.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:behavior.place_block": {
    "placeable_carried_blocks": [],
    "randomly_placeable_blocks": [],
    "can_place": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "on_place": {
      "event": "",
      "filters": {
        "AND": null,
        "NOT": null,
        "OR": null,
        "all": null,
        "all_of": null,
        "any": null,
        "any_of": null,
        "none_of": null
      },
      "target": "self"
    },
    "xz_range": {
      "max": 2,
      "min": -2
    },
    "y_range": {
      "max": 3,
      "min": 0
    },
    "chance": 1,
    "affected_by_griefing_rule": true
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more