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)
Sync: updated from Minecraft
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
(2 intermediate revisions by the same user not shown)
Line 21: Line 21:


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.
:{{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.
:{{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.


Line 94: Line 94:
: 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 {{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}}
{{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}}
{{Result table|succeed}}
{{Result table|The specified [[Minecraft:world clock]] does not exist, a default world clock is not available in the current dimension, the specified [[Minecraft:timeline]] does not belong to the specified world clock, the specified time marker does not exist, or the clock is already at the specified time, paused, running, or at the specified rate.|error}}
{{Result table|cmd=|succeed}}
{{Result table}}
{{Result table}}


Line 137: Line 137:
|{{HistoryLine||v0.16.0|dev=build 1|Added {{cmd|time|link=none}}.}}  
|{{HistoryLine||v0.16.0|dev=build 1|Added {{cmd|time|link=none}}.}}  
|{{HistoryLine|bedrock}}
|{{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 {{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|upcoming Bedrock}}
|{{HistoryLine||26.50|dev=Preview 26.50.26|exp=Creator World Clocks Features|Added {{cmd|time of}} for modifying world clocks.|Supports {{cd|add}}, {{cd|set}}, {{cd|pause}}, {{cd|resume}} and {{cd|query time}}. {{cd|set}} can also target a time marker.}}
}}
}}



Latest revision as of 11:09, 19 August 2026

Template:Infobox command

Changes or queries the Minecraft:world's game Minecraft:time or the time of a Minecraft:world clock.

Usage

There are four types of time involved in this command:

  • Gametime - The total number of Minecraft:game ticks that have elapsed in the world.Template:Note
  • 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.

/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 day or /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 Minecraft:world clock's daylight cycle time.
time pause
time of <clock> pause
Pauses the specified world clock.
time query gametime
Queries the number of Minecraft:game ticks that have passed in the world.Template:Note
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 rate <rate>
time of <clock> rate <rate>
Sets the time advancement speed multiplier of the specified world clock.
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:Argument

Specifies the time to add or set.
Template:Arg desc

Template:Code

Specifies the time to query. Must be daytime, gametime or day.

Template:El: Template:Code
Template:El: Template:Argument

Specifies the time to set.
Must be one of the following:

Template:El: Template:Argument

Specifies the Minecraft: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 Minecraft: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:Result table 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 Minecraft: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

Notes

Template:Notelist

External links

Navigation

Template:Navbox commands

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