minecraft:behavior.dig for you with a switch.Get GodCraftOverview
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
| Field | Type | Default | Description |
|---|---|---|---|
duration | number | 0 | How many seconds digging takes. |
idle_time | number | 0 | Seconds with no disturbance needed before digging can start. |
allow_dig_when_named | boolean | false | If true, the mob can still dig away after being given a name tag. |
vibration_is_disturbance | boolean | false | If true, nearby vibrations count as disturbances and delay digging. |
suspicion_is_disturbance | boolean | false | If true, spotting new suspicious places delays digging. |
digs_in_daylight | boolean | false | If true, the mob starts digging when it sees daylight. |
on_start | ActorDefinitionTrigger | {"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. |
priority | integer | 0 | Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to … |
control_flags | Goal's control flags[] | none | Which 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
}
}