If I trigger a command block to summon a redstone block 5 chunks away, (which subsequently triggers several other command blocks) but the server render distance is set to 4 chunks, will the redstone block still be summoned and execute the other command blocks?
-
Rule of thumb: Nothing happens unless it's closer than the render distance or inside the spawn chunks. That's true in 99% of cases. Understanding the remaining one percent takes days of learning how the game works, but you usually don't need it. – Fabian Röling Mar 19 '18 at 13:00
If the chunk in question is not loaded, then no. Commands like /fill
and /setblock
cannot affect unloaded chunks, and will fail with an error message.
Some options:
- Ensure that the chunks will be loaded, either by putting the command blocks in the spawn chunks or by building a chunk loader of some kind.
- Instead of using command blocks, use functions. I recommend this option, as functions have much better performance than command blocks and are easier to edit once you get started. Then, instead of placing a redstone block, you can just do
/function my_namespace:my_function
to run your commands.
-
I just looked into functions and it looks interesting, but primarily a lot of the command blocks I am using are for "vanilla-friendly" minigames. A lot require a previous action to be done first, and functions seem to do all instructions in one tick. As an example, I need to summon minecarts on a single point, spread them around that single point, then teleport them all to a specific y level (as spreadplayers teleports to top block). I'm not sure how this sequence would work using functions. – Jake Bristow Mar 19 '18 at 13:23
-
@JakeBristow yes, I guess that is like the biggest issue with functions. To provide timing, command blocks are still needed. Maybe a scoreboard-based clock that triggers functions via commandblocks located at spawn might do the trick. – Manchineel Mar 19 '18 at 15:31
-
I think I might just set up the "control room" of command blocks beneath the respective minigame, that way it's always guaranteed to be loaded. Thank you for your advice though! – Jake Bristow Mar 19 '18 at 15:38
-
@JakeBristow The first point in this answer about placing the command blocks in the spawn chunk is a good option. The spawn chunks are always loaded if there is a player anywhere in the world. Here is the wiki on spawn chunk. I recommend your control room be in these chunks. – IronAnvil Mar 20 '18 at 0:43