2021-10-08 12:59:03 +02:00
{
2021-10-08 13:04:13 +02:00
"$id" : "blockception.minecraft.behavior.entities.minecraft.timer" ,
2021-10-08 12:59:03 +02:00
"type" : "object" ,
2021-10-08 13:04:13 +02:00
"title" : "Timer" ,
2021-10-08 12:59:03 +02:00
"description" : "Adds a timer after which an event will fire." ,
"required" : [ ] ,
"additionalProperties" : false ,
"properties" : {
2021-10-11 18:10:42 +02:00
"looping" : {
"type" : "boolean" ,
"default" : true ,
2022-07-22 19:41:04 +02:00
"description" : "If true, the timer will restart every time after it fires." ,
2021-10-11 18:10:42 +02:00
"title" : "Looping"
} ,
2021-10-08 12:59:03 +02:00
"randomInterval" : {
"type" : "boolean" ,
"default" : true ,
2022-07-22 19:41:04 +02:00
"description" : "If true, the amount of time on the timer will be random between the Minimum and Maximum values specified in time." ,
2021-10-08 12:59:03 +02:00
"title" : "Random Interval"
} ,
"time" : {
"description" : "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." ,
"title" : "Time" ,
2022-02-08 16:15:37 +01:00
"examples" : [ 1 , [ 1.0 , 5.0 ] ] ,
2021-10-08 12:59:03 +02:00
"oneOf" : [
{
"type" : "array" ,
"default" : [ 0.0 , 0.0 ] ,
"items" : [
2022-02-08 16:15:37 +01:00
{ "type" : "number" , "title" : "Minimum" } ,
{ "type" : "number" , "title" : "Maximum" }
2021-10-08 12:59:03 +02:00
]
} ,
2022-02-08 16:15:37 +01:00
{ "type" : "number" , "default" : 0 }
2021-10-08 12:59:03 +02:00
]
} ,
"time_down_event" : {
2022-07-22 19:41:04 +02:00
"description" : "Event to fire when the time on the timer runs out." ,
2021-10-08 12:59:03 +02:00
"title" : "Time Down Event" ,
2022-08-22 19:13:13 +01:00
"$ref" : "../types/event_object.json"
2021-10-08 12:59:03 +02:00
} ,
"random_time_choices" : {
"type" : "array" ,
"default" : [ ] ,
"description" : "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." ,
"title" : "Random Time Choices" ,
"items" : {
"title" : "Random Time Choices" ,
"description" : "representing one value in seconds that can be picked before firing the event and an optional weight. Incompatible with time." ,
"type" : "object" ,
"additionalProperties" : false ,
"properties" : {
"weight" : {
"type" : "integer" ,
2022-07-22 19:41:04 +02:00
"description" : "The weight on how likely this section is to trigger." ,
2021-10-08 12:59:03 +02:00
"$comment" : "UNDOCUMENTED" ,
"title" : "Weight"
} ,
2021-10-11 18:10:42 +02:00
"value" : {
"type" : "integer" ,
2022-07-22 19:41:04 +02:00
"description" : "The value in seconds that would be used if this section was picked." ,
2022-06-21 13:59:15 +01:00
"$comment" : "UNDOCUMENTED" ,
2021-10-11 18:10:42 +02:00
"title" : "Value"
}
2021-10-08 12:59:03 +02:00
}
}
}
2021-10-11 18:10:42 +02:00
} ,
"examples" : [
{
2022-02-08 16:15:37 +01:00
"time" : 1 ,
2021-10-11 18:10:42 +02:00
"looping" : true ,
2022-06-21 13:57:41 +01:00
"time_down_event" : {
"event" : "example:foo" ,
"target" : "self"
}
2021-10-11 18:10:42 +02:00
}
]
2021-10-08 12:59:03 +02:00
}