minecraft:behavior.timer_flag_3 for you with a switch.Get GodCraftOverview
minecraft:behavior.timer_flag_3 is an entity component: it goes in the components object of a custom mob, or in one of its component groups. A general-purpose timer goal: it fires an event when it starts, runs for a while, then fires another event when it ends or gets interrupted. While it runs, query.timer_flag_3 returns 1, so you can use it to drive animations. Three of these (timer_flag_1 to 3) let you run separate timers.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
duration_range | FloatRange | {"max":0,"min":0} | Random length, in seconds, that the goal runs. |
cooldown_range | FloatRange | {"max":0,"min":0} | Random wait, in seconds, before the goal can run again. If set, it also applies before the very first run. |
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"} | Event that runs when the goal starts. |
on_end | ActorDefinitionTrigger | {"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 when the goal ends or is interrupted. |
priority | integer | 0 | Decides which goal wins when several want to run: lower numbers run first.Range: 0 to … |
control_flags | Goal's control flags[] | none | Lists 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.timer_flag_3": {
"duration_range": {
"max": 0,
"min": 0
},
"cooldown_range": {
"max": 0,
"min": 0
},
"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"
},
"on_end": {
"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,
"control_flags": []
}
}