Minecraft:Commands/time: Difference between revisions
More actions
imported>Nixinova →Usage: 26.1 released |
Remove broken links to missing pages |
||
| Line 4: | Line 4: | ||
* 2 {{only|java|short=1}} | * 2 {{only|java|short=1}} | ||
* 1 {{only|bedrock|short=1}} | * 1 {{only|bedrock|short=1}} | ||
|others= | |others=Cheat only{{only|bedrock|short=1}} | ||
}} | }} | ||
Changes or queries the | Changes or queries the world's game time or the time of a world clock. | ||
== Usage == | == Usage == | ||
There are four types of time involved in this command: | There are four types of time involved in this command: | ||
* '''Gametime''' - The total number of | * '''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 {{gmr|advance_time}} is <code>false</code>. | * '''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 {{gmr|advance_time}} is <code>false</code>. | ||
* '''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. | * '''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. | * '''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}}, if the world is frozen by the {{cmd|tick}} command, the four times above do not elapse. | {{IN|java}}, if the world is frozen by the {{cmd|tick}} command, the four times above do not elapse. | ||
* '''World clock time''' - the time the | * '''World clock time''' - the time the world clock is set to. | ||
<code>/time set ...</code> command {{in|java}} always directly sets the daylight cycle time to the specified number. But {{in|bedrock}}, when {{cd|time: TimeSpec}} is specified, it '''increases''' the daylight cycle time to meet the specified {{cd|time: TimeSpec}}. | <code>/time set ...</code> command {{in|java}} always directly sets the daylight cycle time to the specified number. But {{in|bedrock}}, when {{cd|time: TimeSpec}} is specified, it '''increases''' the daylight cycle time to meet the specified {{cd|time: TimeSpec}}. | ||
| Line 28: | Line 28: | ||
: <code>time add <nowiki><time></nowiki></code> | : <code>time add <nowiki><time></nowiki></code> | ||
: <code>time<nowiki/> of <clock> add <ti<nowiki/>me></code> | : <code>time<nowiki/> of <clock> add <ti<nowiki/>me></code> | ||
:: Adds <code><<nowiki/>time></code> to the specified | :: Adds <code><<nowiki/>time></code> to the specified world clock's daylight cycle time. | ||
: <code>time pause</code> | : <code>time pause</code> | ||
: <code>time of <clock> pause</code> | : <code>time of <clock> pause</code> | ||
:: Pauses the specified world clock. | :: Pauses the specified world clock. | ||
: <code>time query gametime</code> | : <code>time query gametime</code> | ||
:: Queries the number of | :: Queries the number of game ticks that have passed in the world. | ||
: <code>time query time</code> | : <code>time query time</code> | ||
: <code>time of <clock> query time</code> | : <code>time of <clock> query time</code> | ||
| Line 79: | Line 79: | ||
{{el|je|short=1}}: {{argument|clock|resource}} | {{el|je|short=1}}: {{argument|clock|resource}} | ||
: Specifies the | : Specifies the world clock to operate on. If not specified ({{cmd|time|link=none}} instead of {{cmd|time of <clock>|link=none}}), defaults to the default world clock of the dimension of execution. Currently, only the [[Minecraft:Overworld]] and [[Minecraft:the End]] have default world clocks, which are {{cd|minecraft:overworld}} and {{cd|minecraft:the_end}} respectively. | ||
: Executing without specifying a world clock in a dimension without a default world clock raises an error. | : Executing without specifying a world clock in a dimension without a default world clock raises an error. | ||
: Must be a namespaced [[Minecraft:identifier]] of a registry registered in the {{cd|minecraft:world_clock}} | : Must be a namespaced [[Minecraft:identifier]] of a registry registered in the {{cd|minecraft:world_clock}} registry. | ||
{{el|je|short=1}}: {{argument|timemarker|resource}} | {{el|je|short=1}}: {{argument|timemarker|resource}} | ||
| Line 110: | Line 110: | ||
* To set the daylight cycle time to 1,000: <code>time set 1000</code> | * To set the daylight cycle time to 1,000: <code>time set 1000</code> | ||
* To add one | * To add one day to the daylight cycle time: <code>time add 24000</code> | ||
* To change/reset in-game day count to desired number: <code>time set <desired day number*24000+time of day in ticks></code>; to change day count to day 472 at noon (6000): <code>time set 11334000</code> | * To change/reset in-game day count to desired number: <code>time set <desired day number*24000+time of day in ticks></code>; to change day count to day 472 at noon (6000): <code>time set 11334000</code> | ||
| Line 144: | Line 144: | ||
{{Navbox commands}} | {{Navbox commands}} | ||
de:Befehl/time | |||
es:Comandos/time | |||
ja:コマンド/time | |||
pt:Comandos/time | |||
ru:Команды консоли/time | |||
uk:Команди консолі/time | |||
zh:命令/time | |||
Revision as of 15:45, 9 April 2026
Changes or queries the world's game time or the time of a world clock.
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 Template:Gmr is
false. - 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.
Template:IN, if the world is frozen by the Template:Cmd command, the four times above do not elapse.
- World clock time - the time the world clock is set to.
/time set ... command Template:In always directly sets the daylight cycle time to the specified number. But Template:In, when Template:Cd is specified, it increases the daylight cycle time to meet the specified Template:Cd.
For example:
- Template:In, when executing
/time set dayor/time set 1000, the daylight cycle time is set to 1000, so the "day" value returns to 0. - Template:IN, 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 using Template:Cd. 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
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 (Template:Cd.
- 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
- Specifies the time to add or set.
- Template:Arg desc
- Specifies the time to query. Must be
daytime,gametimeorday.
Template:El: Template:Code
Template:El: Template:Argument
- Specifies the time to set.
- Must be
day,night,noon,midnight,sunriseTemplate:Only, orsunsetTemplate:Only.day= 1,000night= 13,000noon= 6,000midnight= 18,000sunrise= 23,000Template:Onlysunset= 12,000Template:Only
Template:El: Template:Argument
- Specifies the world clock to operate on. If not specified (Template:Cmd instead of Template:Cmd), defaults to the default world clock of the dimension of execution. Currently, only the Minecraft:Overworld and Minecraft:the End have default world clocks, which are Template:Cd and Template:Cd respectively.
- Executing without specifying a world clock in a dimension without a default world clock raises an error.
- Must be a namespaced Minecraft:identifier of a registry registered in the Template:Cd registry.
Template:El: Template:Argument
- 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.
Template:El: Template:Argument
- Specifies the timeline to query.
- Must be a namespaced identifier of a registry registered in the Template:Cd registry.
Result
Template:Update Template:Result table Template:Result table Template:Result table Template:Result table
Output
Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table
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
Bedrock Edition
External links
de:Befehl/time es:Comandos/time ja:コマンド/time pt:Comandos/time ru:Команды консоли/time uk:Команди консолі/time zh:命令/time