minecraft:behavior.timer_flag_2
Fires an event when this behavior starts, then waits for a duration before stopping. When stopping due to that timeout or due to being interrupted by another behavior, fires another event. query.timer_flag_2 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
duration_range | Object | {"max": 0, "min": 0} | Goal duration range in seconds. |
min | Decimal | 0 | |
max | Decimal | 0 | |
cooldown_range | Object | {"max": 0, "min": 0} | Goal cooldown range in seconds. If specified, the cooldown will have to elapse even before the goal can be selected for the first time. |
min | Decimal | 0 | |
max | Decimal | 0 | |
on_start | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Event(s) to run when the goal starts. |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
on_end | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Event(s) to run when the goal ends. |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Sniffer uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.timer_flag_2": {
"priority": 2,
"control_flags": [
"move"
],
"cooldown_range": {
"min": 0.0,
"max": 0.0
},
"duration_range": {
"min": 2.0,
"max": 5.0
},
"on_end": {
"event": "on_rising_end",
"target": "self"
}
}
}Used by 1
Vanilla entities with minecraft:behavior.timer_flag_2 in their definition:
Related components
behavior.random_strollbehavior.random_look_aroundbehavior.equip_itembehavior.move_towards_home_restrictionbehavior.timer_flag_1behavior.look_at_entitybehavior.move_towards_dwelling_restrictionbehavior.drink_potionbehavior.jump_to_blockbehavior.squid_divebehavior.squid_idlebehavior.squid_move_away_from_groundbehavior.squid_out_of_waterbehavior.croakbehavior.dragondeathbehavior.drink_milkbehavior.emergebehavior.investigate_suspicious_locationbehavior.lay_downbehavior.napbehavior.rise_to_liquid_levelbehavior.rollbehavior.silverfish_merge_with_stonebehavior.silverfish_wake_up_friends