Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/time: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Remove broken links to missing pages
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
 
Line 15: Line 15:
* '''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.
{{MC/In|java}}, if the world is frozen by the {{MC/Cmd|tick}} command, the four times above do not elapse.
* '''World clock time''' - the time the world clock is set to.
* '''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 {{MC/In|java}} always directly sets the daylight cycle time to the specified number. But {{MC/In|bedrock}}, when {{MC/Cd|time: TimeSpec}} is specified, it '''increases''' the daylight cycle time to meet the specified {{MC/Cd|time: TimeSpec}}.


For example:
For example:
:{{In|java}}, when executing <code>/time set day</code> or <code>/time set 1000</code>, the daylight cycle time is set to 1000, so the "day" value returns to 0.
:{{MC/In|java}}, when executing <code>/time set day</code> or <code>/time set 1000</code>, the daylight cycle time is set to 1000, so the "day" value returns to 0.
:{{IN|bedrock}}, when executing <code>/time set 1000</code>, the daylight cycle time is also set to 1000. But, for <code>/time set day</code>, if now the daylight cycle time is 25001 (1 day + 1001 ticks), after executing <code>/time set day</code>, it won't become 1000 or 25000, since '''it only increases the daylight cycle time''' when using {{cd|time: 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 <code>/time set day</code>, it remains unchanged.
:{{MC/In|bedrock}}, when executing <code>/time set 1000</code>, the daylight cycle time is also set to 1000. But, for <code>/time set day</code>, if now the daylight cycle time is 25001 (1 day + 1001 ticks), after executing <code>/time set day</code>, it won't become 1000 or 25000, since '''it only increases the daylight cycle time''' when using {{MC/Cd|time: 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 <code>/time set day</code>, it remains unchanged.


==Syntax==
==Syntax==
Line 60: Line 60:


==Arguments==
==Arguments==
{{argument|time|time|amount: int|int}}
{{MC/Argument|time|time|amount: int|int}}
: Specifies the time to add or set.
: Specifies the time to add or set.
: {{arg desc|je=time|min=0|be=int}}
: {{MC/Arg desc|je=time|min=0|be=int}}


{{code|daytime{{!}}gametime{{!}}day}}
{{code|daytime{{!}}gametime{{!}}day}}
: Specifies the time to query. Must be <code>daytime</code>, <code>gametime</code> or <code>day</code>.
: Specifies the time to query. Must be <code>daytime</code>, <code>gametime</code> or <code>day</code>.


{{el|je|short=1}}: {{code|day{{!}}night{{!}}noon{{!}}midnight}}<br>
{{MC/El|je|short=1}}: {{code|day{{!}}night{{!}}noon{{!}}midnight}}<br>
{{el|be|short=1}}: {{argument|be=1|time: TimeSpec|enum}}
{{MC/El|be|short=1}}: {{MC/Argument|be=1|time: TimeSpec|enum}}
: Specifies the time to set.
: Specifies the time to set.
: Must be <code>day</code>, <code>night</code>, <code>noon</code>, <code>midnight</code>, <code>sunrise</code>{{only|bedrock}}, or <code>sunset</code>{{only|bedrock}}.
: Must be <code>day</code>, <code>night</code>, <code>noon</code>, <code>midnight</code>, <code>sunrise</code>{{only|bedrock}}, or <code>sunset</code>{{only|bedrock}}.
Line 78: Line 78:
:* <code>sunset</code> = 12,000{{only|bedrock}}
:* <code>sunset</code> = 12,000{{only|bedrock}}


{{el|je|short=1}}: {{argument|clock|resource}}
{{MC/El|je|short=1}}: {{MC/Argument|clock|resource}}
: 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.
: Specifies the world clock to operate on. If not specified ({{MC/Cmd|time|link=none}} instead of {{MC/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 {{MC/Cd|minecraft:overworld}} and {{MC/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}} registry.
: Must be a namespaced [[Minecraft:identifier]] of a registry registered in the {{MC/Cd|minecraft:world_clock}} registry.


{{el|je|short=1}}: {{argument|timemarker|resource}}
{{MC/El|je|short=1}}: {{MC/Argument|timemarker|resource}}
: Specifies the time marker to set the time to
: 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.
: 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.


{{el|je|short=1}}: {{argument|timeline|resource}}
{{MC/El|je|short=1}}: {{MC/Argument|timeline|resource}}
: Specifies the timeline to query.
: Specifies the timeline to query.
: Must be a namespaced identifier of a registry registered in the {{cd|minecraft:timeline}} registry.
: Must be a namespaced identifier of a registry registered in the {{MC/Cd|minecraft:timeline}} registry.


==Result==
==Result==
{{update|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?|section=1}}
{{MC/Update|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?|section=1}}
{{Result table}}
{{Result table}}
{{Result table|The command is incomplete, or any argument is not specified correctly.|unparseable|unparseable}}
{{Result table|The command is incomplete, or any argument is not specified correctly.|unparseable|unparseable}}
Line 100: Line 100:
== Output ==
== Output ==


{{Output table}}
{{MC/Output table}}
{{Output table|cmd=/time add ...<br>/time set ...|edition=je|On success|1|1|the daytime (the daylight cycle time modulo 24000) after execution}}
{{MC/Output table|cmd=/time add ...<br>/time set ...|edition=je|On success|1|1|the daytime (the daylight cycle time modulo 24000) after execution}}
{{Output table|cmd=/time query ...|On success|1|1|the obtained value}}
{{MC/Output table|cmd=/time query ...|On success|1|1|the obtained value}}
{{Output table|cmd=|edition=be|On fail|0}}
{{MC/Output table|cmd=|edition=be|On fail|0}}
{{Output table|On success|1}}
{{MC/Output table|On success|1}}
{{Output table}}
{{MC/Output table}}


==Examples==
==Examples==
Line 116: Line 116:
=== ''Java Edition'' ===
=== ''Java Edition'' ===
{{HistoryTable
{{HistoryTable
|{{HistoryLine|java beta}}
|{{MC/HistoryLine|java beta}}
|{{HistoryLine||1.3|Added {{cmd|time|link=none}}.  Both <code>add</code> and <code>set</code> can be used.}}
|{{HistoryLine||1.3|Added {{MC/Cmd|time|link=none}}.  Both <code>add</code> and <code>set</code> can be used.}}
|{{HistoryLine|java}}
|{{MC/HistoryLine|java}}
|{{HistoryLine||1.3.1|dev=12w16a|{{cmd|time|link=none}} is now usable in singleplayer.
|{{HistoryLine||1.3.1|dev=12w16a|{{MC/Cmd|time|link=none}} is now usable in singleplayer.
|{{cmd|time set|link=none}} now accepts <code>day</code> (equivalent to 0) and <code>night</code> (equivalent to 12500).}}
|{{MC/Cmd|time set|link=none}} now accepts <code>day</code> (equivalent to 0) and <code>night</code> (equivalent to 12500).}}
|{{HistoryLine||1.7.2|dev=13w36a|{{cmd|time set day|link=none}} now is equivalent to 1000, and {{cmd|time set night|link=none}} now is equivalent to 13000.}}
|{{HistoryLine||1.7.2|dev=13w36a|{{MC/Cmd|time set day|link=none}} now is equivalent to 1000, and {{MC/Cmd|time set night|link=none}} now is equivalent to 13000.}}
|{{HistoryLine||1.8|dev=14w29a|Added {{cmd|time query|link=none}}, accepting <code>daytime</code> and <code>gametime</code>.}}
|{{HistoryLine||1.8|dev=14w29a|Added {{MC/Cmd|time query|link=none}}, accepting <code>daytime</code> and <code>gametime</code>.}}
|{{HistoryLine||1.9|dev=15w49b|{{cmd|time query|link=none}} now accepts {{cd|day}} as a value.}}
|{{HistoryLine||1.9|dev=15w49b|{{MC/Cmd|time query|link=none}} now accepts {{MC/Cd|day}} as a value.}}
|{{HistoryLine||1.13|dev=18w01a|Added the options {{cd|noon}} and {{cd|midnight}} to {{cmd|time set|link=none}}.}}
|{{HistoryLine||1.13|dev=18w01a|Added the options {{MC/Cd|noon}} and {{MC/Cd|midnight}} to {{MC/Cmd|time set|link=none}}.}}
|{{HistoryLine||26.1|dev=snap3|The {{cmd|time}} command is now based on world clocks.|The return value (e.g. from {{cmd|execute store}}) from the {{cd|set}} and {{cd|add}} subcommands is now the total elapsed ticks of the clock instead of the current time of day.}}
|{{HistoryLine||26.1|dev=snap3|The {{MC/Cmd|time}} command is now based on world clocks.|The return value (e.g. from {{MC/Cmd|execute store}}) from the {{MC/Cd|set}} and {{MC/Cd|add}} subcommands is now the total elapsed ticks of the clock instead of the current time of day.}}
|{{HistoryLine|||dev=pre1|Added {{cmd|time [of <clock>] rate <rate>}}.}}
|{{HistoryLine|||dev=pre1|Added {{MC/Cmd|time [of <clock>] rate <rate>}}.}}
}}
}}


=== ''Bedrock Edition'' ===
=== ''Bedrock Edition'' ===
{{HistoryTable
{{HistoryTable
|{{HistoryLine|pocket alpha}}
|{{MC/HistoryLine|pocket alpha}}
|{{HistoryLine||v0.16.0|dev=build 1|Added {{cmd|time|link=none}}.}}  
|{{HistoryLine||v0.16.0|dev=build 1|Added {{MC/Cmd|time|link=none}}.}}  
|{{HistoryLine|bedrock}}
|{{MC/HistoryLine|bedrock}}
|{{HistoryLine||1.17.30|dev=beta 1.17.30.20|Now {{cd|/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.}}  
|{{HistoryLine||1.17.30|dev=beta 1.17.30.20|Now {{MC/Cd|/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.}}  
}}
}}


Line 142: Line 142:


== Navigation ==
== Navigation ==
{{Navbox commands}}
{{MC/Navbox commands}}


de:Befehl/time
de:Befehl/time

Latest revision as of 20:14, 9 April 2026

Template:Infobox command

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.

in Template:Editions, if the world is frozen by the

  1. REDIRECT Template:Command

Template:Redr command, the four times above do not elapse.

  • World clock time - the time the world clock is set to.

/time set ... command in Template:Editions always directly sets the daylight cycle time to the specified number. But in Template:Editions, when

  1. REDIRECT Template:Code

Template:Redr is specified, it increases the daylight cycle time to meet the specified

  1. REDIRECT Template:Code

Template:Redr.

For example:

in Template:Editions, when executing /time set day or /time set 1000, the daylight cycle time is set to 1000, so the "day" value returns to 0.
in Template:Editions, 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
  1. REDIRECT Template:Code

Template:Redr. 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.
time pause
time 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 time
time of <clock> query time
Queries the number of game ticks that have passed in a <clock>.
time query <timeline> repetition
time of <clock> query <timeline> repetition
Queries the number of repetitions that have passed using <clock>'s timeline <timeline>.
time query <timeline>
time of <clock> query <timeline>
Queries the number of game ticks passed in this repetition of <clock>'s timeline <timeline>.
time resume
time 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.
time query <daytime|gametime|day>
Queries current time.
time set <amount: int>
time set <time: TimeSpec>
Sets the daylight cycle time.

Arguments

Template:El<time>: time
Template:El: amount: int: int

Specifies the time to add or set.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|time}}{{#vardefine:be-arg|integer}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Template:Code

Specifies the time to query. Must be daytime, gametime or day.
  1. REDIRECT Template:Edition

Template:Rcat: Template:Code

  1. REDIRECT Template:Edition

Template:Rcat: time: TimeSpec: enum

Specifies the time to set.
Must be day, night, noon, midnight, sunriseTemplate:Only, or sunsetTemplate:Only.
  1. REDIRECT Template:Edition

Template:Rcat: <clock>: resource

Specifies the world clock to operate on. If not specified (
  1. REDIRECT Template:Command

Template:Redr instead of

  1. REDIRECT Template:Command

Template:Redr), 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

  1. REDIRECT Template:Code

Template:Redr and

  1. REDIRECT Template:Code

Template:Redr 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
  1. REDIRECT Template:Code

Template:Redr registry.

  1. REDIRECT Template:Edition

Template:Rcat: <timemarker>: resource

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.
  1. REDIRECT Template:Edition

Template:Rcat: <timeline>: resource

Specifies the timeline to query.
Must be a namespaced identifier of a registry registered in the
  1. REDIRECT Template:Code

Template:Redr registry.

Result

Template:Message boxTemplate:Article other Template:Result table Template:Result table Template:Result table Template:Result table

Output

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the daytime (the daylight cycle time modulo 24000) after execution}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/time add ...
/time set ...
}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the obtained value}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/time query ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|Any}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|be}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}

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

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

External links

Navigation

All editions
Removed
Template:El only
Debug
Removed
Template:Els only
Template:El only
Removed
Template:El only
Removed
Template:Els only
Removed
Joke
Related

de:Befehl/time es:Comandos/time ja:コマンド/time pt:Comandos/time ru:Команды консоли/time uk:Команди консолі/time zh:命令/time