4

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.

1
  • If do not have access to Minecraft right now, so I can't write a comprehensive answer. Here is a two toggle flip flop one that does exactly what you need. The only trick is implementing it in redstone. If nobody has built and tested this in seven hours, I will gladly.
    – Rainbolt
    Commented Apr 14, 2015 at 14:28

3 Answers 3

4

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

enter image description here

Back

enter image description here

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.

enter image description here

2
  • 1
    How did you make your screenshots look like that? It's amazing :D
    – Lars
    Commented Apr 15, 2015 at 16:14
  • 1
    @Lars I'm using anti blocks from some mod (I'm at work, and my Google skills are failing me right now). They have no texture and are unaffected by lighting, which makes them ideal for demonstrating redstone designs. Also, I did some manual erasing in Microsoft Paint to get rid of some ugly black spots (you can see them in the last screenshot if you look closely, because I got lazy). If I remember, I'll update the answer with the mod's name when I get home. I'm sure the mod author would appreciate it.
    – Rainbolt
    Commented Apr 15, 2015 at 16:30
1

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.

1
  • can you show me a screenshot of what this looks like? Commented Apr 14, 2015 at 22:35
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.