Add multiple commands to a single command block, and alternate with +/- redstone power [duplicate]

Add multiple commands to a single command block, and alternate with +/- redstone power [duplicate] - Cable Wire Tied on Post

I am playing around with command blocks, and I just wanted to know if you could have multiple commands in one command block. If you can, is it possible to have one of the commands active when the command block is powered, and the other activate when the block is not powered?

Example:

  • CMD 1) is powered would be {setblock ~ ~1 ~ 152}
  • CMD 2) is not powered would be {setblock ~ ~1 ~ 0}

Is it possible?



Best Answer

No. That is an unusually specific feature that would be very clearly advertised.

To do this, use two command blocks: one directly connected to the redstone and the other connected through an inverter. (If timing is critical, you may need to put a delay circuit on the 'directly' connected command block's input line, to match the delay through the inverter.)




Pictures about "Add multiple commands to a single command block, and alternate with +/- redstone power [duplicate]"

Add multiple commands to a single command block, and alternate with +/- redstone power [duplicate] - Bald eagle flying in countryside
Add multiple commands to a single command block, and alternate with +/- redstone power [duplicate] - Long dangerous crocodile with open mouth and rugged scales on body crawling on stony surface near calm pond in zoological area
Add multiple commands to a single command block, and alternate with +/- redstone power [duplicate] - Blue wires connected to contemporary electronic equipment with multiple inputs on blur background



How do you put multiple commands in one command block?

To make your command block run multiple commands, you will need to summon FallingSand or falling_block (depending on your version of Minecraft) with command blocks and redstone blocks for each command. The command blocks will be stacked one on top of the other and contain the individual command.

How do you make a repeating Redstone Command Block?

To get a repeating command block, players must use the /give command like so: /give @p minecraft:repeating_command_block <amount> . Players can also change a normal command block into a repeating command block by selecting the option in the command block GUI.



how to activate Redstone with a command block




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Sebastian Bischof, David Selbert, Thành Trần, Brett Sayles