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]

Do I need to completely finish Season 1 before starting Season 2 Walking Dead? Do I need to completely finish Season 1 before starting Season 2 Walking Dead?

Posted On: March 25, 2023
The second season of The Walking Dead episodic game has just been released. I've not yet finished all the episodes from season one. Is the second season a continuation of the same story ( so ma...[More]


Elder Scrolls V: Is there a reliable, continuous source for dragon locations? Elder Scrolls V: Is there a reliable, continuous source for dragon locations?

Posted On: August 26, 2023
I'm trying to gather bones and scales to make armor for one character, and I've come to realize that there's never really any dragons around when you want them to be. Is there a reliabl...[More]


Tips for beating Ranrok Tips for beating Ranrok

Posted On: September 1, 2023
Does anybody have any tips of beating Ranrok? I’m having a hard time fighting him. I’ve looked at tutorials but it hasn’t helped. Question from user According-Finger-34 at Hogwart...[More]


Hogwarts Legacy, What the hell was that? Hogwarts Legacy, What the hell was that?

Posted On: June 9, 2023
Okay.. I was just running around doing some easy side quests (or so I thought) and saw a cute little house elf selling a shop. Fast forward a few minutes and I suddenly end up in a literal HORROR G...[More]


Whats the best strategy to keep the chaos low in Dishonored? Whats the best strategy to keep the chaos low in Dishonored?

Posted On: May 6, 2023
I know that having a high chaos would cause the game to be more difficult. So I'm wondering how could I keep it low and avoid killing methods that would raise the chaos. Question from user Warf...[More]


BG3 map is incredibly small. BG3 map is incredibly small.

Posted On: May 29, 2024
The entire Wilderness map grid is 310 squares from top to bottom. .As each D&D grid square is 1,5 meters, it means the map is only 465 meters from top to bottom.If we consider it's 465 meters wide, th...[More]


lost my honour mode run in the most embarrassing way ever lost my honour mode run in the most embarrassing way ever

Posted On: January 17, 2025
So, here I am. .I have just defeated the emerald grove or whatever it's called and am now looting the empty goblin camp. It's really dark so I walk with a torch equipped in my hand and see some crate...[More]


Does Improved Catalyst increase self-damage from Rigged Bombs? Does Improved Catalyst increase self-damage from Rigged Bombs?

Posted On: August 20, 2023
The description for Improved Catalyst says that Bombs and Rigged Bombs will deal +10 damage. Normally Rigged Bombs deal 150 damage to enemies and 3 self damage to the player. Does Improved Catalyst...[More]


What does disliking a player do in DOTA 2? What does disliking a player do in DOTA 2?

Posted On: October 18, 2023
If I click "dislike player" after a match, what does that do? Question from user nightblade9 at stackexchange. Answer: Dota 2 Summer 2023 Patch notes state:. Additionally, we&rsq...[More]


What defines a JRPG, and how is it different from an RPG? What defines a JRPG, and how is it different from an RPG?

Posted On: July 5, 2023
I've always wondered if JRPG, or Japanese Role-Playing Game, has any concrete definition for it. I'm only curious now because lately I've seen a lot of people referencing Genshin Impact...[More]