/time
< Commands
/time| Permission level required |
|
|---|---|
| Restrictions |
{
"title": "<code>/time</code>",
"rows": [
{
"field": "\n* 2 <sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Java Edition\">(link to Java Edition article, displayed as JE) only</span></i>]</sup>\n* 1 <sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "(link to Cheat article, displayed as Cheat) only<sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Changes or queries the world's game time or the time of a world clock[upcoming JE 26.1].
Usage
There are four types of time involved in this command:
- Gametime - The total number of game ticks that have elapsed in the world.
- Daylight cycle time (aka. internal daytime) - The total number of game ticks that have elapsed during the daylight cycle. It does not elapse when the game rule
advance_timeisfalse. - Daytime - The number of game ticks that have elapsed since sunrise on current day. It is the result of dividing the daylight cycle time modulo 24,000.
- Day - The number of days that have elapsed during the daylight cycle. It is the result of floor division by 24,000 of the daylight cycle time.
In Java Edition, if the world is frozen by the /tick command, the four times above do not elapse.
- World clock time[upcoming JE 26.1] - the time the world clock is set to.
/time set ... command in Java Edition always directly sets the daylight cycle time to the specified number. But in Bedrock Edition, when time: TimeSpec is specified, it increases the daylight cycle time to meet the specified time: TimeSpec.
For example:
- in Java Edition, when executing
/time set dayor/time set 1000, the daylight cycle time is set to 1000, so the "day" value returns to 0. - In Bedrock Edition, when executing
/time set 1000, the daylight cycle time is also set to 1000. But, for/time set day, if now the daylight cycle time is 25001 (1 day + 1001 ticks), after executing/time set day, it won't become 1000 or 25000, since it only increases the daylight cycle time when usingtime: TimeSpec. In fact, it turns into 49000 (2 days + 1000 ticks), and the "day" value becomes 2. If now the daylight cycle time is 25000 (1 day + 1000 ticks), after executing/time set day, it remains unchanged.
Syntax
- Java Edition[until JE 26.1]
time add <time>- Adds
<time>to the in-game daytime.
- Adds
time query (daytime|gametime|day)[until JE 26.1]- Queries current time.
time set (day|night|noon|midnight)[until JE 26.1]time set <time>- Sets the daylight cycle time.
- Java Edition[upcoming JE 26.1]
time add <time>time of <clock> add <time>- Adds
<time>to the specified world clock's daylight cycle time.
- Adds
time pausetime of <clock> pause- Pauses the specified world clock.
time query gametime- Queries the number of game ticks that have passed in the world.
time query timetime of <clock> query time- Queries the number of game ticks that have passed in a
<clock>.
- Queries the number of game ticks that have passed in a
time query <timeline> repetitiontime of <clock> query <timeline> repetition- Queries the number of repetitions that have passed using
<clock>'s timeline<timeline>.
- Queries the number of repetitions that have passed using
time query <timeline>time of <clock> query <timeline>- Queries the number of game ticks passed in this repetition of
<clock>'s timeline<timeline>.
- Queries the number of game ticks passed in this repetition of
time resumetime of <clock> resume- Resumes the specified world clock
time set (<time>|<timemarker>)time of <clock> set (<time>|<timemarker>)- Sets the specified world clock's daylight cycle time to the specified time or time marker (
(day|night|noon|midnight).
- Sets the specified world clock's daylight cycle time to the specified time or time marker (
- Bedrock Edition
time add <amount: int>- Adds
<time>to the daylight cycle time.
- Adds
time query <daytime|gametime|day>- Queries current time.
time set <amount: int>time set <time: TimeSpec>- Sets the daylight cycle time.
Arguments
JE: <time>: time
BE: amount: int: int
- Specifies the time to add or set.
- In Java Edition, it must be a single-precision floating-point number suffixed with a unit. It must be not less than 0 gameticks. Units include:
d: an in-game day, 24000 gameticks;s: a second, 20 gameticks;t(default and omitable): a single gametick; the default unit.
.5dis same as 12000 gameticks.
In Bedrock Edition it must be a [Int] 32-bit integer number.
daytime|gametime|day
- Specifies the time to query. Must be
daytime,gametimeorday.
JE: day|night|noon|midnight
BE: time: TimeSpec: enum
- Specifies the time to set.
- Must be
day,night,noon,midnight,sunrise[Bedrock Edition only], orsunset[Bedrock Edition only].day= 1,000night= 13,000noon= 6,000midnight= 18,000sunrise= 23,000[Bedrock Edition only]sunset= 12,000[Bedrock Edition only]
- Specifies the world clock to operate on. If not specified (
/timeinstead of/time of <clock>), defaults to the default world clock of the dimension of execution. Currently, only the Overworld and the End have default world clocks, which areminecraft:overworldandminecraft:the_endrespectively. - Executing without specifying a world clock in a dimension without a default world clock raises an error.
- Must be a namespaced identifier of a registry registered in the
minecraft:world_clockregistry.
- Specifies the time marker to set the time to
- Must be a namespaced identifier. Upon execution, the command either attempts to retrieve an unregistered item based on this identifier, or send it to the client for processing.
- Specifies the timeline to query.
- Must be a namespaced identifier of a registry registered in the
minecraft:timelineregistry.
Result
This section needs to be updated.
Please update this section to reflect recent updates or newly available information. The talk page may contain suggestions.
Reason: In 26.1, there are more errors regarding world clock, such as not specifying one in a dimension without a default world clock. Can someone knowing the difference between unparseable, error, and failed add this?
Reason: In 26.1, there are more errors regarding world clock, such as not specifying one in a dimension without a default world clock. Can someone knowing the difference between unparseable, error, and failed add this?
| Command | Trigger | Java Edition | Bedrock Edition |
|---|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable | Unparseable |
| Otherwise | Successful | ||
Output
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
/time add ... | Java Edition | On success | 1 | 1 | the daytime (the daylight cycle time modulo 24000) after execution |
/time query ... | On success | 1 | 1 | the obtained value | |
| Any | Bedrock Edition | On fail | 0 | N/A | N/A |
| On success | 1 | N/A | N/A |
Examples
- To set the daylight cycle time to 1,000:
time set 1000 - To add one day to the daylight cycle time:
time add 24000 - To change/reset in-game day count to desired number:
time set <desired day number*24000+time of day in ticks>; to change day count to day 472 at noon (6000):time set 11334000
History
Java Edition
| Java Edition Beta | |||||||
|---|---|---|---|---|---|---|---|
| 1.3 | Added /time. Both add and set can be used. | ||||||
| Java Edition | |||||||
| 1.3.1 | 12w16a | /time is now usable in singleplayer.
| |||||
/time set now accepts day (equivalent to 0) and night (equivalent to 12500). | |||||||
| 1.7.2 | 13w36a | /time set day now is equivalent to 1000, and /time set night now is equivalent to 13000. | |||||
| 1.8 | 14w29a | Added /time query, accepting daytime and gametime. | |||||
| 1.9 | 15w49b | /time query now accepts day as a value. | |||||
| 1.13 | 18w01a | Added the options noon and midnight to /time set. | |||||
| Upcoming Java Edition | |||||||
| 26.1 | snap3 | The /time command is now based on world clocks. | |||||
The return value (e.g. from /execute store) from the set and add subcommands is now the total elapsed ticks of the clock instead of the current time of day. | |||||||
Bedrock Edition
| Pocket Edition Alpha | |||||||
|---|---|---|---|---|---|---|---|
| v0.16.0 | build 1 | Added /time. | |||||
| Bedrock Edition | |||||||
| 1.17.30 | beta 1.17.30.20 | Now /time set <amount: int> directly sets the daylight cycle time to the specified number, instead of incrementing the daylight cycle time to satisfy the specified daytime. | |||||
External links
- "
/timeCommand" – Microsoft Learn, October 11, 2023.