Arqade is a question and answer site for passionate videogamers on all platforms. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup something similar to the MindCrack team's current server set up for my single player world so that the world border expands slowly as I play the game. I already know how to work the worldborder command, I just want it to happen at the exact same time every game day.

I know that you can query for the time with time query daytime which gives you the time of the day in ticks. I would set up a comparator to test the output. I just can't seem to get the testfor command to work with this. I figure I'm doing something wrong. I would guess the code would be something like this testfor [time query daytime = 1000] but of course that was wrong.

Anyone know if what I want to do is even possible?

share|improve this question
If you want to have an expanding border, then why don't you just ask how to get it? I can't answer this question, but I can tell you how to get an expanding border. Please change your question if possible. – BlaXpirit Aug 23 '14 at 17:14
Welp, had to make another question to make my answer appropriate. – BlaXpirit Aug 23 '14 at 17:49
up vote 2 down vote accepted

You're along the right path with /time query daytime.

First of all, create an objective. In these examples I'll use "TimeObjective" although you can call it whatever you want:

/scoreboard objectives add TimeObjective dummy

Next, put /time query daytime into a command block. Then stand ontop of the command block and type this. Again, "TimePlayer" is just a fake player name, it can be anything so long as it's consistent:

/stats block ~ ~-1 ~ set QueryResult TimePlayer TimeObjective

Now, whenever the command block is activated, the current time will be stored in TimePlayer's TimeObjective score. Set that block on a clock. To test the score of a player that doesn't actually exist, you need to use this command rather than /testfor:

/scoreboard players test <PLAYER> <OBJECTIVE> <MIN> <MAX>

So for this case:

/scoreboard players test TimePlayer TimeObjective 0 1000
share|improve this answer
Awesome works except you forgot one command, that I had to look up. /scoreboard players add TimePlayer TimeObjective 0 then the command block produced the right output. Thanks for your help works exactly like I wanted. – JRSofty Aug 23 '14 at 18:37
Well it would work perfectly if the time query returned correctly. It seems as of now using MC 1.8-pre1 is that unless you issue a command /time set day or such then the time continues the count and doesn't start over from 0 as it is shown in the wiki. I think I'm probably going to check with Mojang's bug tracker and see if this is an open issue. – JRSofty Aug 23 '14 at 18:53
Mojang confirmed it is a bug. A modolo 24000 is missing. – JRSofty Aug 24 '14 at 6:13
Just to inform everyone who reads this. The bug I've mentioned in the comment above has been corrected and everything is working correctly as of Minecraft 1.9 – JRSofty Apr 22 at 7:01

Ok I figured it out for what I was doing it was easy I just put a comparator up next to a command block with this command in it:

/time query daytime

Then I had two pieces of redstone going from that comparator to a block with a torch on it going to a command block.

share|improve this answer
This doesnt actually answer the question. And it doesn't even look like an answer. – ydobonebi Aug 12 '15 at 21:31

If you are still interested in this, a way you can get around the bug where the time doesn't reset to zero, is test for if the time query is 24000, like with:

/scoreboard players test timeFakePlayer time 23990 24000

Then have the comparator set the time to 0 with /time set 0 since that time of day is equal to zero

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.