Minecraft:Commands/time: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| Line 70: | Line 70: | ||
{{el|be|short=1}}: {{argument|be=1|time: TimeSpec|enum}} | {{el|be|short=1}}: {{argument|be=1|time: TimeSpec|enum}} | ||
: Specifies the time to set. | : Specifies the time to set. | ||
: Must be | : Must be one of the following: | ||
:* <code>day</code> = 1,000 | :* {{EnvSprite|sunrise}} <code>sunrise</code> = 23,000{{only|bedrock}} | ||
:* <code> | :* {{EnvSprite|day}} <code>day</code> = 1,000 | ||
:* <code> | :* {{EnvSprite|noon}} <code>noon</code> = 6,000 | ||
:* <code> | :* {{EnvSprite|sunset}} <code>sunset</code> = 12,000{{only|bedrock}} | ||
:* | :* {{EnvSprite|night}} <code>night</code> = 13,000 | ||
:* {{EnvSprite|midnight}} <code>midnight</code> = 18,000 | |||
{{el|je|short=1}}: {{argument|clock|resource}} | {{el|je|short=1}}: {{argument|clock|resource}} | ||
Latest revision as of 11:06, 14 June 2026
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.
- World clock time - the time the Minecraft: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 Minecraft:world clock's daylight cycle time.
- Adds
time pausetime 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 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 one of the following:
- Template:EnvSprite
sunrise= 23,000Template:Only - Template:EnvSprite
day= 1,000 - Template:EnvSprite
noon= 6,000 - Template:EnvSprite
sunset= 12,000Template:Only - Template:EnvSprite
night= 13,000 - Template:EnvSprite
midnight= 18,000
- Template:EnvSprite
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: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 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
Bedrock Edition
Notes
External links
Minecraft:de:Befehl/time Minecraft:es:Comandos/time Minecraft:ja:コマンド/time Minecraft:pt:Comandos/time Minecraft:ru:Команды консоли/time Minecraft:uk:Команди консолі/time Minecraft:zh:命令/time