Commands/time

From Minecraft Wiki
Jump to: navigation, search
time
Permission level required

2‌[JE only]
1‌[BE only]

Restrictions

Cheat only‌[BE only]

Changes or queries the world's game time. In Bedrock Edition, time add, time query and time set are three separated commands.

Syntax[edit]

  • Java Edition
time add <time>
Adds <time> to the in-game daytime.
time query (daytime|gametime|day)
Queries current time.
time set <TimeSpec>
time set <time>
Sets the in-game daytime.
  • Bedrock Edition
time add <amount: int>
Adds <time> to the in-game daytime.
time query <daytime|gametime|day>
Queries current time.
time set <amount: int>
time set <time: TimeSpec>
Sets the in-game daytime.

Arguments[edit]

JE<time>: time
BE: amount: int: int

Specifies the time to add or set.
Must be a time in Minecraft.
In Java Edition, it must be a single-precision floating point number suffixed with a unit. Units include:
  • d: an in-game day, 24000 gameticks;
  • s: a second, 20 gameticks;
  • t (default and omitable): a single gametick; the default unit.
The time is set to the closest integer tick after unit conversion. For example. .5d is same as 12000 ticks.
In Bedrock Edition it must be a 32-bit integer number.

daytime|gametime|day

Specifies the time to query. Must be daytime, gametime or day.
  • daytime - the number of game ticks since dawn. (the in-game daytime modulo 24000)
  • gametime - the age of the world in game ticks. (the game time modulo 2147483647)
  • day - the number of in-game days passed. (the in-game daytime divided by 24000, then modulo 2147483647)

JE: <TimeSpec> : literal (day|night|noon|midnight)
BE: time: TimeSpec

Must be day, night, noon, midnight, sunrise[Bedrock Edition only], or sunset[Bedrock Edition only].
Specifies the time to set(day = 1,000, night = 13,000, noon = 6,000, midnight = 18,000, sunrise = 23,000‌[Bedrock Edition only], sunset = 12,000‌[Bedrock Edition only]).

Result[edit]

CommandTriggerJava EditionBedrock Edition
anythe arguments are not specified correctly Unparseable Failed
On successChanges or queries the time.

Output[edit]

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
/time add ...
/time set ...
Java EditionOn success11the time of this day (the in-game daytime modulo 24000) after execution
/time query ...On success11the obtained value
anyBedrock EditionOn fail0N/AN/A
On success1N/AN/A

Examples[edit]

  • To set the time to 1,000: time set 1000 or time set day
  • To add one day to the world time: time add 24000

History[edit]

Java Edition Beta
1.3Added /time. Both add and set can be used.
Java Edition
1.3.112w16a/time is now usable in singleplayer.
/time set now accepts day (equivalent to 0) and night (equivalent to 12500).
1.713w36a/time set day now is equivalent to 1000, and /time set night now is equivalent to 13000.
1.814w29aAdded /time query, accepting daytime and gametime.
1.915w49b/time query now accepts day as a value.
1.1318w01aAdded the options noon and midnight to /time set.
Pocket Edition Alpha
v0.16.0build 1Added /time.