I've hit a problem while making a map. I want one command block to activate on the the first pulse but another when I hit the button a second time.
If there are any Redstone pros out here then could you please help me with this challenging feat.
I've hit a problem while making a map. I want one command block to activate on the the first pulse but another when I hit the button a second time.
If there are any Redstone pros out here then could you please help me with this challenging feat.
I want one command block to activate on the the first pulse but another when I hit the button a second time.
You need a flip-flop (more specifically, a T flip-flop). In electronics, a flip-flop is a circuit that toggles between two states. Here is how you might build a T Flip Flop in redstone:
Front
Back
I borrowed the design from the Gamepedia's page on Minecraft memory circuits. How does it work? Press the button, and the output turns on. Press it again, and the output turns off. (The output is the trail of redstone at the bottom right of the first picture. In both pictures, output is "On".)
Note that a wooden button will not work with this design, but you can find other designs on the linked page that will work with wooden buttons.
That's cool and all, but how does this solve my problem with the Command Blocks?
Take the output redstone and split it into two trails. Invert one of the trails. Now one is always on, and the other is always off. Problem solved.
Below is a picture of how to do this. Pretend that the top left torch is the output of the first circuit.
Okay, this is my attempt at answering this question:
[Command1 in Command Block], Redstone repeater, Command block with command: /setblock ~2 ~ ~ command_block 0 replace {Command:"Command2"}
These need to be placed along the x axis of the map with the second command block 2 blocks in a positive direction ahead of the first. (Use F3
to check direction, look at pointing-at
co-ords)
I hope this fits your needs.
Trigger a t-flipflop to toggle which command block to activate
C
t
rRBrPO rC
BBPBBBBBB
B is solid block r is redstone dust R is repeater P is piston c is command block t is redstone torch O is redstone block
the lower piston is facing up, the upper piston is facing right and is sticky.
The left piston creates a 1 tick pulse, the right sticky piston is a t-flip flop. When the lower command block is activated, the torch will turn off and when the t-flip-flop is triggered again the lower command block will de-activate and the torch will turn on activating the top piston.