How can I toggle between two blocks on button press with a command block?

How can I toggle between two blocks on button press with a command block? - Crop anonymous tattooed carpenter pressing button on professional electric equipment while standing with wooden plank near table

I want to change a concrete block from red to green and vice-versa, when players click a button. How can I achieve this with a command block?






Pictures about "How can I toggle between two blocks on button press with a command block?"

How can I toggle between two blocks on button press with a command block? - Numbers Wall Decor
How can I toggle between two blocks on button press with a command block? - 123 Cutout Decor on Red Surface
How can I toggle between two blocks on button press with a command block? - Handshake Between Two People



How do you toggle a command block?

How to Access Command Blocks
  • Head to your multicraft control panel and select the Config Files tab on the left hand side.
  • Select Server Settings which will be at the top of the page.
  • Scroll down the page until you find Enable Command Blocks.
  • Set this setting to Enabled and then click save.


  • How do you activate multiple command blocks with one button?

    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 use command blocks with buttons?

    How to get a Command Block
  • Enable cheats in your world or Realm settings.
  • Turn on Creative Mode in your world or Realm settings.
  • Open the chat box and enter \u201c/give [your username] command_block\u201d
  • Place the block where you want it.


  • How do you Chain 2 command blocks?

    Setting up the Reward Command Block
  • Place another command block next to the existing block. ...
  • Open the command block interface.
  • Set the Block Type to Chain.
  • Set the Condition to Conditional.
  • Set the Redstone to Always Active.
  • Set the Command Input to /give @p emerald .




  • Minecraft Commands: Toggling Light Switch Tutorial




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

    Images: Ono Kosuki, Magda Ehlers, Magda Ehlers, Ron Lach