4

Can you increase the amount of time in a day? Minecraft has the same amount of time each day, but what if you want to have longer days and shorter nights so zombies wont have as much time to kill you. Is there a command out there so I can extend the time of day in vanilla Minecraft for my world?

2
  • AFAIK there is no such command in Vanilla Minecraft. You can use commands to set current time of the day and thus not even allow for the night to come, or wait for night, hunt some monsters down and when done just skip to day. There are mods though that allow such commands.
    – Asunez
    Feb 18, 2016 at 8:07
  • 5
    Related: gaming.stackexchange.com/questions/129607/…
    – MrLemon
    Feb 18, 2016 at 10:56

2 Answers 2

8

For shorter nights you can increase the rate at which time increases using the /time add command. The simplest method would be to use an inverted daylight sensor.

Example using 1.9's Repeating Command Block, set to "Needs Redstone", with an inverted daylight sensor on top of it:

Inverted daylight sensor atop repeating command block

The command is very simply:

/time add 1

This will double the speed that time passes during night. Setting the value higher will increase the speed further.

4
  • Could a similar method be used to do the opposite during the day? Feb 18, 2016 at 15:38
  • @Studoku: I believe using a regular daylight sensor would do what you ask for. AFAIK that is done by right-clicking on the sensor.
    – Gyfis
    Feb 18, 2016 at 16:00
  • If you did /time add 10 would that make the night pass 10 times as quickly?
    – TMH
    Feb 18, 2016 at 16:58
  • 1
    @TomHart It would go 11 times as quickly. Use /time add 9 to go at 10x speed
    – Angelica
    Mar 27, 2016 at 21:44
3

This can be done with a command block contraption that basically combines telling time with slowing down/speeding up time.

Seeing that 1.9 will be released just next week, I'll use 1.9's new command blocks for this.

First, set the gamerules commandBlockOutput and doDaylightCycle to false to turn off command block spam and the natural daylight cycle. We'll need an objective to store a timer.

/scoreboard objectives add time dummy

Furthermore we'll use several fake players, whose names all start with a #. These are not valid player names and don't ever show up on the scoreboard.

Now, we need to start by figuring out what time it is and store it somewhere we can access it. Set up a repeat command block and put:

/time query daytime

Stand on top of the this command block and run

/stats block ~ ~-1 ~ set QueryResult #DAYTIME time

to automatically store the result of the time query on #DAYTIME.

We can now use /scoreboard players test #DAYTIME time <min> [max] to check for specific time ranges, and use conditional command blocks to trigger different "clocks".

Make a new chain of command blocks and set all of the chain command blocks to "conditional":

/scoreboard players test #DAYTIME time <min> <max>
/scoreboard players add #TIMER time 1
/scoreboard players test #TIMER time <X>
/time add <Y>
/scoreboard players set #TIMER time 0

Replace <min>, <max>, <X> and <Y> with appropriate numbers. When the daytime is between <min> and <max> (inclusive), time will advance at a rate of <Y>/<X> the normal speed. For example, to slow down the day to half-speed, use 0, 12000, 2, 1, respectively.

Note that higher values of <X> will cause time to "stutter", because it's only advanced every <X> ticks. Also, in the case of <X> = 1, you can leave out the 2nd, 3rd and 5th commands entirely.

4
  • Just mentioning that if using 1.9, /time query daytime no longer returns the raw daytime value, and instead returns a value with the modulo operation already applied, so that manual operation can be skipped (but luckily will not break existing contraptions that use it). On an unrelated note, this pre-operation had prevented our ability to determine how many days has passed in a pre-existing world, as we no longer have a raw value to divide from. To make up for that, we now have /time query day, which returns how many in-game days have passed based on the raw daytime value.
    – Skylinerw
    Feb 18, 2016 at 13:11
  • @Skylinerw neat changes, thanks for the info. I changed the answer.
    – MrLemon
    Feb 18, 2016 at 13:27
  • Thanks a lot for this. I had to run /scoreboard players add #DAYTIME time 0 before the cycle started working (running 1.11.2), so maybe that needs to be added to the instructions.
    – user95834
    Mar 12, 2017 at 1:02
  • Also, following these directions means that, e.g. when the time reaches 12000, time will stop advancing. A second chain is needed to advance the nighttime.
    – user95834
    Mar 12, 2017 at 1:53

Not the answer you're looking for? Browse other questions tagged .