How to Apply Commands to Minecraft Redstone Machines
In Creative mode, command blocks aren’t just a substitution for circuits. In Minecraft, command blocks activate whenever they’re powered by redstone current — thus, when linked into a redstone circuit, they can function in interesting ways. There are different ways to integrate command blocks and circuits.
Creating impossible machines with command circuits
Sometimes, redstone circuits simply cannot perform certain functions. For example, you can’t transmit information remotely, you can’t complete complex algorithms in a short time, and many machines have to be at least a certain physical size. The addition of command blocks can help you ignore most of these restrictions.
Commands can execute many different functions to manipulate any part of the world, making them much more versatile than the circuitry tools available in Survival mode. Here are some ways you can improve your circuits with command blocks:
Create more complex input and output. Command blocks can change the world in many different ways. Instead of pushing blocks with pistons, use the clone tool to move entire platforms in otherwise unimaginable ways. Rather than use simple iron doors, build beautiful walls that crumble in multicolor explosions with the push of a button. When using command blocks, never feel limited by the constraints of normal redstone circuits.
Use command blocks to modify the components of a circuit. Command blocks can rotate redstone repeaters, place redstone blocks, and more with the setblock command. For example, if you want a circuit to activate a device elsewhere, just place a redstone block next to the device.
Use command blocks to store memory, not memory latches. The memory latch is useful for storing a single bit of information (or more, if you string together multiple memory latches). However, command blocks make this process much easier — whether you use entities, blocks, or scoreboard objectives, command blocks can produce and store information that can easily be accessed by the circuit (usually via testfor or testforblock).
This is what a circuit might look like when implementing command blocks. Note that space efficiency hardly matters any more: The pieces of the circuit are simply put together in a way that best reflects how the program is structured. Because command blocks can affect any part of the world without the need for connections, everything can be part of a single circuit.
Setting command blocks on loops
One particularly useful way to implement a command block is on a loop. This makes the command block activate over and over, which can have some interesting results. Many commands have to be repeated in order to unlock some of their deeper applications.
Before working with these concepts, you should execute the gamerule commandBlockOutput false command first. This command turns off the messages that appear on the Chat menu whenever a command block activates, and it prevents the Chat menu from becoming overloaded with repetitive notices.
Some looped commands can be hazardous to your world. For example, summoning hordes of dragons can cause massive lag, and rapidly teleporting players can block off their access to the world completely. To avoid an apocalyptic faux pas, be sure to give cheating privileges only to players you trust, and make backups of your world before you attempt any risky maneuvers.
Some of the commands that work particularly well inside loops are described in this list:
Placing this command on a loop can slowly drain a certain item from players’ inventories or prevent players from holding that item in their inventory altogether.
It is useful to make a player or a mob or another entity execute a command every now and then. You can give players fun effects, create powerful enemies with special abilities, and even make a bow that leaves a trail of slime when fired.
You can make a player’s items return over time after they’re used or give players bonuses at regular intervals.
Sometimes, special effects don’t last long enough for your purposes. Put this command on a loop and you can produce these effects repeatedly, or even continuously.
Play sounds at different intervals to produce some ambient background sounds.
Display periodical notices or warnings.
You can have fun looping plenty of scoreboard commands. You can change the sidebar display to slowly cycle between a few objectives or rapidly increase a player’s score like a stopwatch, for example.
By repeatedly setting a certain space in the world to a certain block, you can produce some interesting results, especially if you do so with part of a circuit.
Sometimes, a single entity isn’t enough to provide a sufficient function or challenge. Swarms of entities are often much more interesting. A block that constantly summons entities can be handy, whether you’re creating mobs or items. Don’t overdo it, though — a large number of complex entities can slow down the game.
This command provides messages with many different functions, so it is often useful to ensure that the player always has access to these sorts of messages.
testfor, testforblock, testforblocks
These commands are extremely useful when looped. You can rapidly check for a certain parameter and, when it’s met, execute a command or circuit.
Teleport an entity to a certain position every once in a while. Teleporting players repeatedly this way has some uses, but can often be irritating.
You can teleport mobs and the like by using the tp command.
Many players like to rewrite the Experience bar to act as a customized gauge. If you do this, you can put this command on a loop to make players’ experience points gradually increase by rapidly adding a constant. This constant can be negative, making experience points slowly deplete.