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]

How can I fix a Minecraft stair to its shape? How can I fix a Minecraft stair to its shape?

Posted On: July 2, 2023
I am trying to build an arch roof using stairs and in doing so I need stairs to get a fixed stair shape. Here are some pictures to clarify:. Two stairs together can form a corner stair:. However...[More]


Are there unique weapons - items that must be pickpocketed from NPCs? Are there unique weapons - items that must be pickpocketed from NPCs?

Posted On: April 1, 2024
I'm playing Dragonborn DLC, and I just used my last skill point to unlock Misdirection, a Pickpocket skill that lets me pickpocket equipped weapons.I was pretty lucky because the first time I used it ...[More]


Dynamic Lighting in (vanilla) Minecraft Dynamic Lighting in (vanilla) Minecraft

Posted On: August 25, 2023
I have already seen tutorials on Minecraft regarding dynamic lighting, but none of them seem fancy enough. What I'm thinking of is a way to make dynamic lighting that is clean and not destructi...[More]


In Hogwarts, Am I just glitched? In Hogwarts, Am I just glitched?

Posted On: March 4, 2023
So I definitely got the treasure here, but it says I didn't. it's happening at another place as well . Am I just glitched? Question from user coreyc2099 at HogwartsLegacyGaming at reddit.co...[More]


Orpheus or emperor? Orpheus or emperor?

Posted On: June 14, 2024
I just started act 3 and I’m a bit confused. I’m currently trying to romance laezel and I really want to try get the best possible ending with her. I talked to the emperor and I took the worm he g...[More]


Feel like I’m completely done with act 1, I’m an early lvl 6 Feel like I’m completely done with act 1, I’m an early lvl 6

Posted On: October 24, 2023
I’ve scoured the map. Killed everyone I think I am supposed to and ventured to all the spots, goblin camp, under dark, ancient forge, Ethel. I feel like I’ve been able to kill all enemi...[More]


Does the solution to The Shoe Store Thief include the price of the shoes? Does the solution to The Shoe Store Thief include the price of the shoes?

Posted On: April 9, 2023
In Professor Layton and the Diabolical Box, puzzle 20 (The Shoe Store Thief) involves a woman who uses a counterfeit $50 bill to buy a $30 pair of shoes. The puzzle asks how much money the shoe-store ...[More]


Is there a way to de-fuse weapons in Zelda Tears of the Kingdom? Is there a way to de-fuse weapons in Zelda Tears of the Kingdom?

Posted On: May 17, 2023
Sometimes I want to de-fuse a weapon because I've found a better component I want to add, or a better weapon to use that component. Is there a way to de-fuse a weapon or shield? Question from u...[More]


My Karlach cosplay! My Karlach cosplay!

Posted On: July 25, 2024
Question from user Svizee at BaldursGate3 at reddit.com.Answer:This cosplay is a geological phenomenon. meaning it rocks. ?.Answer from user Kamen-Reader at BaldursGate3 at reddit.com....[More]


New player here - does shadowheart suck early game? New player here - does shadowheart suck early game?

Posted On: November 15, 2024
I’m playing on Tactician. I thought healing would be nice to have but because it’s limited by having to long rest (and I’m trying to save camp supplies) I am very conservative with it. I feel li...[More]