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

minecraft:behavior.take_block

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

Overview

minecraft:behavior.take_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 pick up a block from the world and carry it around, like an enderman. Pair it with place_block so it can put the block down again.

Fields

FieldTypeDefaultDescription
blocksBlock Descriptor[]noneWhich blocks may be picked up. Leave empty to allow any block.
can_takeFilter 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 taking a block.
on_takeActorDefinitionTrigger{"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 taken.
xz_rangeIntRange{"max":2,"min":-2}Sideways range around the entity where blocks can be taken.
y_rangeIntRange{"max":3,"min":0}Up and down range around the entity where blocks can be taken.
chancenumber1Chance each tick that the entity tries to take a block.Range: 0 to 1
affected_by_griefing_rulebooleantrueIf true, the goal stops working when the mobGriefing game rule is off.
requires_line_of_sightbooleantrueIf true, the entity must be able to see the block to take it.
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.take_block": {
    "blocks": [],
    "can_take": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "on_take": {
      "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,
    "requires_line_of_sight": true
  }
}

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