1. Wiki
  2. /Entities
  3. /minecraft:timer

minecraft:timer

Don't want to write this by hand? GodCraft sets minecraft:timer for you with a switch.Get GodCraft

Overview

minecraft:timer is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Starts a countdown and runs an event when it reaches zero. Great for delays, like a fuse or a mob that changes after a while.

Fields

FieldTypeDefaultDescription
loopingBoolean"true"If true, the timer starts over each time it finishes.
randomIntervalBoolean"true"If true, the time is picked randomly between the two values in time.
random_time_choicesList"[ ]"Possible times in seconds, each with an optional weight; don't use it together with time.
timeRange [a, b]"[0.0, 0.0]"Countdown length in seconds, either one number or a min and max pair.
time_down_eventStringnoneEvent to run when the timer reaches zero.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:timer": {
    "looping": "true",
    "randomInterval": "true",
    "random_time_choices": "[ ]",
    "time": "[0.0, 0.0]",
    "time_down_event": ""
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more