Why remove redstone dust from my command block contraptions?

[BACK]
Why remove redstone dust from my command block contraptions?
Posted On: December 29, 2023

Whenever I show my command block contraptions to my friends, they always comment that I should remove the redstone dust from them. They say it causes lag and that redstone can be unpredictable, but I've never had a problem like that. 


Even if I did, I would just slow down the clock I'm using a bit and add comparators or repeaters to get it to work. Besides, if I don't use redstone dust, how am I supposed to activate things like pistons and redstone lamps?


If I need redstone dust in order to make my command block contraptions work, why am I being told to get rid of it? What logical reason is there for this?


Question from user MBraedley at stackexchange.


Answer:

Your friends are right, redstone dust is evil and it should be avoided at all costs when making command block contraptions. Redstone dust does cause lag and it can be unpredictable. There's a nice blog post explaining why this is the case, but suffice it to say that pretty much every expert map maker limits their use of redstone dust to very specific edge cases, and it's never used on high frequency lines.


So, what should you be using instead? For a clock, use a 20Hz clock. Better yet, start using 1.9 and use repeating command blocks. For turning on a redstone device, use setblock to place a redstone block or torch at the activation point. This is especially useful for when your command blocks are far away from any redstone contraption (as they should be).


The only actual redstone that you should have in your command block contraption is redstone blocks (for activating the command blocks), comparators (for testing for a success on a command block, but even these aren't necessary; use the stats command instead), and on the extremely rare occasion, a repeater. Also, sometimes a button or switch, but that should be given. But that's for 1.8, and in 1.9, the entire command block game changes. 1.9 will allow you to remove even more redstone, to the point where you don't need any (not even a switch or button) to do something useful. Again, you'll need to be able to interface with redstone devices from time to time, but as I said above, that should be done with something like a setblock command.


In the end, you should do your best to keep your redstone stuff and your command block stuff separated. There was a time when this wasn't possible, but that was ages and ages ago, when the command block was first introduced. New commands made it possible to separate your redstone and command blocks, and with the new features in 1.9, this becomes even easier to do; you no longer need to think about how to build a 20Hz clock, execution order is trivialized to block placement, and conditional execution becomes built in. Redstone dust is great for making interesting contraptions in survival, but it has no place in your creative mode command blocks.


Minecraft v1.13 has changed the game again. Now, you don't even need command blocks in your world, you can use functions instead and tag them to run either every tick, or when the world loads. (Admittedly, some of this was available in earlier versions, but 1.13 was a major update to commands which made for a compelling reason to move as much as possible to functions.).


Command blocks will still be necessary in some very narrow circumstances (conditional execution in some cases is still difficult using just functions), but other than prototyping, I would recommend using functions instead of command blocks for most purposes. There's loads of reasons for doing this, but among the top reasons I see are:.


Code reuse and deduplication.


Maintainability.


Ease of reading.


Something to keep in mind, though, is that a number of commands have been removed/replaced in 1.13, such as the stats command mentioned above (the new version as part of the execute command is actually a lot easier and more intuitive now). The power of commands has grown substantially since the command block was introduced in 1.4, but redstone has only seen incremental improvements. Most of the improvements in redstone were with the addition of blocks aimed at eliminating the need for BUD switches (those blocks being daylight detector and observer blocks). Other than that, there isn't much in the way of new redstone, whereas commands have been evolving almost with every release.


Answer from user MBraedley at stackexchange.



[BACK]
Why remove redstone dust from my command block contraptions?
Posted On: December 29, 2023

Whenever I show my command block contraptions to my friends, they always comment that I should remove the redstone dust from them. They say it causes lag and that redstone can be unpredictable, but I've never had a problem like that. 


Even if I did, I would just slow down the clock I'm using a bit and add comparators or repeaters to get it to work. Besides, if I don't use redstone dust, how am I supposed to activate things like pistons and redstone lamps?


If I need redstone dust in order to make my command block contraptions work, why am I being told to get rid of it? What logical reason is there for this?


Question from user MBraedley at stackexchange.


Answer:

Your friends are right, redstone dust is evil and it should be avoided at all costs when making command block contraptions. Redstone dust does cause lag and it can be unpredictable. There's a nice blog post explaining why this is the case, but suffice it to say that pretty much every expert map maker limits their use of redstone dust to very specific edge cases, and it's never used on high frequency lines.


So, what should you be using instead? For a clock, use a 20Hz clock. Better yet, start using 1.9 and use repeating command blocks. For turning on a redstone device, use setblock to place a redstone block or torch at the activation point. This is especially useful for when your command blocks are far away from any redstone contraption (as they should be).


The only actual redstone that you should have in your command block contraption is redstone blocks (for activating the command blocks), comparators (for testing for a success on a command block, but even these aren't necessary; use the stats command instead), and on the extremely rare occasion, a repeater. Also, sometimes a button or switch, but that should be given. But that's for 1.8, and in 1.9, the entire command block game changes. 1.9 will allow you to remove even more redstone, to the point where you don't need any (not even a switch or button) to do something useful. Again, you'll need to be able to interface with redstone devices from time to time, but as I said above, that should be done with something like a setblock command.


In the end, you should do your best to keep your redstone stuff and your command block stuff separated. There was a time when this wasn't possible, but that was ages and ages ago, when the command block was first introduced. New commands made it possible to separate your redstone and command blocks, and with the new features in 1.9, this becomes even easier to do; you no longer need to think about how to build a 20Hz clock, execution order is trivialized to block placement, and conditional execution becomes built in. Redstone dust is great for making interesting contraptions in survival, but it has no place in your creative mode command blocks.


Minecraft v1.13 has changed the game again. Now, you don't even need command blocks in your world, you can use functions instead and tag them to run either every tick, or when the world loads. (Admittedly, some of this was available in earlier versions, but 1.13 was a major update to commands which made for a compelling reason to move as much as possible to functions.).


Command blocks will still be necessary in some very narrow circumstances (conditional execution in some cases is still difficult using just functions), but other than prototyping, I would recommend using functions instead of command blocks for most purposes. There's loads of reasons for doing this, but among the top reasons I see are:.


Code reuse and deduplication.


Maintainability.


Ease of reading.


Something to keep in mind, though, is that a number of commands have been removed/replaced in 1.13, such as the stats command mentioned above (the new version as part of the execute command is actually a lot easier and more intuitive now). The power of commands has grown substantially since the command block was introduced in 1.4, but redstone has only seen incremental improvements. Most of the improvements in redstone were with the addition of blocks aimed at eliminating the need for BUD switches (those blocks being daylight detector and observer blocks). Other than that, there isn't much in the way of new redstone, whereas commands have been evolving almost with every release.


Answer from user MBraedley at stackexchange.



[BACK]

Is Engi Med-Bot Dispersal affected by MedBay upgrades? Is Engi Med-Bot Dispersal affected by MedBay upgrades?

Posted On: August 4, 2023
The title pretty much says it all. Do med-bay upgrades make healing in rooms besides the med-bay faster when you have med-bot dispersal? Question from user Fambida at stackexchange. Answer: T...[More]


How to turn off the Hey, look at that Points! notifications from Xbox Game Bar? How to turn off the Hey, look at that Points! notifications from Xbox Game Bar?

Posted On: March 17, 2023
Every once in a while on the PC, mostly when I start playing a game but sometimes if I'm not playing anything, I get a little popup from the Xbox Game Bar that says "Hey, look at that -- Poin...[More]


How do you flip a troll’s club into it’s face? How do you flip a troll’s club into it’s face?

Posted On: August 2, 2023
I see that objective a lot in the Duelling feats. I know you’re supposed to use flippendo, but whenever I use it on a troll it just does nothing or slows it’s movement for a second. What i...[More]


I bought Hogwarts Legacy and wow it’s a solid game but the nostalgia is crazy I bought Hogwarts Legacy and wow it’s a solid game but the nostalgia is crazy

Posted On: July 16, 2023
Honestly super fun and as soon as you buy a broom you could do that all day definitely worth buying. Question from user Gullible_Hand2393 at HogwartsLegacyGaming at reddit. Answer: It is wild...[More]


Sona-Taric League Of Legends bot lane in Season 9 Sona-Taric League Of Legends bot lane in Season 9

Posted On: May 11, 2023
At the time of writing, the combination of Sona and Taric is extremely powerful in pro play. What is the reasoning and strategy behind professional League teams taking both Sona and Taric bot lane?...[More]


Can I complete Fallout 4s Home Sweet Home without enraging the Minute Men? Can I complete Fallout 4s Home Sweet Home without enraging the Minute Men?

Posted On: July 9, 2023
I want to get the perks for completing Nuka World but don't want Preston to shoot me in the face. Is this possible?. I'm playing the sort of character who wouldn't side with the Raid...[More]


How much HP does Ygdar Orus Li Ox revive you with? How much HP does Ygdar Orus Li Ox revive you with?

Posted On: April 12, 2023
The "Ygdar Orus Li Ox" mutation "saves you one time if you die prematurely while not cursed". Do you stay at 1hp when you get saved, or do you get a bit of extra HP so you don'...[More]


What does a checkmark in the Monster List mean? What does a checkmark in the Monster List mean?

Posted On: November 27, 2023
When looking at the Monster List, what does it mean when a monster has a green checkmark next to them? Question from user Stevoisiak at stackexchange. Answer: A green checkmark means you have...[More]


Why is the fishing rod so helpful for PvP in old combat? Why is the fishing rod so helpful for PvP in old combat?

Posted On: September 26, 2023
I have always played PvP on servers like Hypixel, and for years I've noticed that I always get a fishing rod when I duel other players. I have used it, but I have never seen a difference when I ac...[More]


Why do I create 2 characters when starting a new playthrough? Why do I create 2 characters when starting a new playthrough?

Posted On: August 8, 2023
The character creation process is very confusing to me. I know it's early access and things are being polished continuously, but it's unclear why I need to create 2 characters. After comple...[More]