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

minecraft:behavior.dig

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

Overview

minecraft:behavior.dig is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that makes the mob burrow into the ground and vanish, like the Warden when it calms down.

Fields

FieldTypeDefaultDescription
durationnumber0How many seconds digging takes.
idle_timenumber0Seconds with no disturbance needed before digging can start.
allow_dig_when_namedbooleanfalseIf true, the mob can still dig away after being given a name tag.
vibration_is_disturbancebooleanfalseIf true, nearby vibrations count as disturbances and delay digging.
suspicion_is_disturbancebooleanfalseIf true, spotting new suspicious places delays digging.
digs_in_daylightbooleanfalseIf true, the mob starts digging when it sees daylight.
on_startActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Events that fire when digging begins.
priorityinteger0Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to …
control_flagsGoal's control flags[]noneWhich body parts this goal takes over (move, look, jump), so goals using the same parts cannot run together.

Example

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

BP/entities/<name>.json
{
  "minecraft:behavior.dig": {
    "duration": 0,
    "idle_time": 0,
    "allow_dig_when_named": false,
    "vibration_is_disturbance": false,
    "suspicion_is_disturbance": false,
    "digs_in_daylight": false,
    "on_start": {
      "event": "",
      "filters": {
        "AND": null,
        "NOT": null,
        "OR": null,
        "all": null,
        "all_of": null,
        "any": null,
        "any_of": null,
        "none_of": null
      },
      "target": "self"
    },
    "priority": 0
  }
}

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