minecraft:behavior.timer_flag_3

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_3 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise.

Properties

PropertyTypeDefaultWhat it does
duration_rangeObject{"max": 0, "min": 0}Goal duration range in seconds.
minDecimal0
maxDecimal0
cooldown_rangeObject{"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.
minDecimal0
maxDecimal0
on_startObject{"event": "", "filters": {"AND": null, "NOT": null, "OR":…Event(s) to run when the goal starts.
eventText""
targetTextself, other, player, target, parent, baby, block, damager, holder, item"self"
filtersObject 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.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
on_endObject{"event": "", "filters": {"AND": null, "NOT": null, "OR":…Event(s) to run when the goal ends.
eventText""
targetTextself, other, player, target, parent, baby, block, damager, holder, item"self"
filtersObject 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.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
priorityIntegermin 00
control_flagsList 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_3": {
    "priority": 5,
    "cooldown_range": {
      "min": 0.0,
      "max": 0.0
    },
    "duration_range": {
      "min": 2.0,
      "max": 5.0
    },
    "on_end": {
      "event": "on_feeling_happy_end",
      "target": "self"
    }
  }
}

Used by 1

Vanilla entities with minecraft:behavior.timer_flag_3 in their definition:

Related components