跳转至

Timer

文档版本:1.21.0.24

Adds a timer after which an event will fire.

架构

timer:
{
  boolean "looping" : opt
  boolean "randomInterval" : opt
  array "time" : opt
  {
    number "0..0" : opt
    number "1..1" : opt
  }
  number "time" : opt
  event_object "time_down_event"
  array "random_time_choices" : opt
  {
    object "<any array element>" : opt
    {
      integer "weight" : opt
      integer "value" : opt
    }
  }
}
loopingboolean
If true, the timer will restart every time after it fires.
randomIntervalboolean
If true, the amount of time on the timer will be random between the Minimum and Maximum values specified in time.
timearray
Amount of time in seconds for the timer. Can be specified as a number or a pair of numbers (Minimum and max). Incompatible with random_time_choices.
time
0..0number
1..1number
timenumber
Amount of time in seconds for the timer. Can be specified as a number or a pair of numbers (Minimum and max). Incompatible with random_time_choices.
time_down_eventevent_object
Event to fire when the time on the timer runs out.
event_object:
{
  filters "filters"
  string "event" : opt
  string "target" : opt
}
filtersfilters
一个过滤器组
eventstring
The event to fire.
targetstring
The target of the event.
random_time_choicesarray
This is a list of objects, representing one value in seconds that can be picked before firing the event and an optional weight. Incompatible with time.
random_time_choices
<any array element>object
representing one value in seconds that can be picked before firing the event and an optional weight. Incompatible with time.
<any array element>
weightinteger
The weight on how likely this section is to trigger.
valueinteger
The value in seconds that would be used if this section was picked.