Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

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 at 17:14
    
Welp, had to make another question to make my answer appropriate. –  BlaXpirit Aug 23 at 17:49

1 Answer 1

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
1  
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 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 at 18:53
    
Mojang confirmed it is a bug. A modolo 24000 is missing. –  JRSofty Aug 24 at 6:13

Your Answer

 
discard

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.