6

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.

2
  • possible duplicate of How to get a slowly expanding world border in Minecraft?
    – MrLemon
    Commented Jul 7, 2015 at 13:38
  • 2
    @MrLemon dont think it is a duplicate because that tells you how to make it expand with time and will not take into sleeping i just want it to expand every time the sun rises
    – RNH
    Commented Jul 7, 2015 at 13:42

3 Answers 3

8

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).

13
  • 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
    Commented Jul 7, 2015 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
    Commented Jul 7, 2015 at 16:04
  • I did that and still the world border did not move
    – RNH
    Commented Jul 7, 2015 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
    Commented Jul 7, 2015 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
    Commented Jul 7, 2015 at 16:29
5

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:

Redstone

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.

4
  • 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
    Commented Jul 7, 2015 at 13:48
  • @ardaozkal Thank you, but it seems he chose you anyways. Commented Jul 7, 2015 at 13:59
  • I used your method in the end
    – RNH
    Commented Jul 7, 2015 at 14:03
  • 3
    @RNH Well, you should accept the method that you used and worked for you. Commented Jul 7, 2015 at 14:04
3

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.

3
  • will the daylight sensor still work if i have it underground
    – RNH
    Commented Jul 7, 2015 at 13:51
  • @RNH unfortunately and AFAIK no.
    – ave
    Commented Jul 7, 2015 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
    Commented Jul 7, 2015 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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