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?
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:
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.
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
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
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
<Y> with appropriate numbers. When the daytime is between
<max> (inclusive), time will advance at a rate of
<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.