I want to make a world with a world border that increases 2 blocks every in game day when the sun rises using command blocks. How would I accomplish this?

I don't completely understand commands so please be really detailed in how to do this.


Both of these solutions require you to have set up your worldborder first, and to know the location of your spawn chunks (the chunks around your world spawn). They need to be built in the spawn chunks so that they are always loaded.

Simple solution

Place a daylight sensor on top of a command block with the following command:

/worldborder add 2

Make sure the daylight sensor is exposed to daylight. The major downside here is that it is not exactly hidden.

Hidden solution

For a server or just general asthetics, it might be good to hide the command blocks deep underground at bedrock level. Unfortunately, this is a little more complicated, but totally doable.

Create a scoreboard objective called daytime using

/scoreboard objectives add daytime dummy

As pointed out by Skylinerw on the Minecraft forums, daytime does not actually reset to 0 every day. Sleeping in a bed advances the daytime forward to a multiple of 24000 instead of setting it to 0. To make this work, we create a second objective and use it to store a number (24000) in a fake player called "#DAYLIGHT" (The "#" is illegal in player names, making this unique).

/scoreboard objectives add MATH dummy
/scoreboard players set #DAYLIGHT MATH 24000

Now, create a setblock or fill-clock running the following commands.

/time query daytime
/stats block <x> <y> <z> set QueryResult @a daytime
/scoreboard players operation @a daytime %= #DAYLIGHT MATH 
/execute @p[score_daytime=1000,score_daytime_min=1000] ~ ~ ~ worldborder add 2

where <x> <y> <z> are the coordinates of the command block with the first command (relative coordinates using ~ work).

| improve this answer | |
  • i cant get your hidden solution to work i dont know what im doing wrong. So far I have a setclock with 3 command blocks around the redstone block with your 3 commands in them and when i do /time set 1000 nothing happens – RNH Jul 7 '15 at 16:02
  • @RNH good comment, I just saw that I actually forgot something. You have to replace <x> <y> <z> with the coordinates for the first command block. – MrLemon Jul 7 '15 at 16:04
  • I did that and still the world border did not move – RNH Jul 7 '15 at 16:05
  • @RNH Hm... it worked for me when I tested it. Then again, I used time set 990 to test it. Try that, and if it works, set the execution time to 1010 instead. Also, use scoreboard objectives setdisplay sidebar daytime to check if the scoreboard updates correctly – MrLemon Jul 7 '15 at 16:10
  • On the third command block i get this message underneath the command "The entity UUID provided is in an invalid format" maybe that has something to with it not working – RNH Jul 7 '15 at 16:29

First place a daylight sensor with a comparator infront of it, with the comparator facing out of the daylight sensor. Then put a command block as the output of the comparator. The redstone should look like following:


Then, inside the command block, type:

/worldborder add 2

How this works is that the daylight sensor will activate each day and when it activates, it will give an input to the comparator which will then execute the command inside the command block and add a distance of 2 to the world border.

| improve this answer | |
  • Duh. You answered faster than me. Edit: I edited my answer and let him know that your take on daylight sensors can be better. – Ave Jul 7 '15 at 13:48
  • @ardaozkal Thank you, but it seems he chose you anyways. – Jacques Marais Jul 7 '15 at 13:59
  • I used your method in the end – RNH Jul 7 '15 at 14:03
  • 3
    @RNH Well, you should accept the method that you used and worked for you. – Jacques Marais Jul 7 '15 at 14:04

Plan 1: (hard&redstone way, no big differences with Plan 2) (not tested)
First of all, you must do a 1 day loop with redstones. And next off, when you connect them to the command block, you must add /worldborder add 2 1 (2 = 2 blocks, 1 = 1 seconds to open) to it.

Plan 2: (easy way) (tested and works)
Put a Daylight Sensor, connect it to a command block, add /worldborder add 2 1 (2 = 2 blocks, 1 = 1 seconds to open) in command block.

Note: Plan 2 might not work, see CommandFox' answer for a better take of this plan.

Plan 3: (tested and works) (world will grow slowly, a new block everymidday)
A minecraft day is 20 minutes. 1200 seconds. So just use this code in console: /worldborder add 2xdays-you-want 1200xdays-you-want. So making this work for 1000 days would be /worldborder add 2000 1200000.

Also if you are mapping, I recommend adding another command block to let the player know that world grew.

| improve this answer | |
  • will the daylight sensor still work if i have it underground – RNH Jul 7 '15 at 13:51
  • @RNH unfortunately and AFAIK no. – Ave Jul 7 '15 at 13:51
  • ok so i tested it and the daylight sensor will work underground but it will turn on at night instead of day – RNH Jul 7 '15 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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