Stop command blocks on clock when sign clicked?

Stop command blocks on clock when sign clicked? - Unrecognizable young woman demonstrating prohibition sign showing gesture of refuse using hand and note with sign stop

I am making a one command creation which means that the command blocks are on a constant clock, I can make a sign on the front of it and I was wondering if there was a way to make it so if that sign is clicked they don't work until it is clicked again.



Best Answer

It's possible if your sign do a setblock to make appear a redstone_block next to one of the commands witch make the fill clock work. By keeping the clock command block activated it won't be able to continue looping.

But you will have to do many tests to find the good relative coordinates in the setblock and whenever you add a new command in your one command creation it make not work anymore since your sign may be at a different place so be shure to add it only when you have finished your one command.

To reactivate the clock you must add 3 commands on the sign:

  1. make disappear the redstone_block you made appear earlier to deactivate the clock.
  2. Make appear a air block between the 2 command blocks which makes the fill clock work.
  3. Make appear a redstone_block again between the 2 command blocks which makes the fill clock work.

Here is an example of the json needed to add multiple commands in 1 sign:

/give @p sign 1 0 {
    BlockEntityTag: {
        Text1: "{text:\" \\\/ \",color:\"gold\",bold:true,clickEvent:{action:\"run_command\",value:\"/setblock ... air\"}}",
        Text2: "{text:\"Click\",color:\"blue\",clickEvent:{action:\"run_command\",value:\"/setblock ... air\"}}",
        Text3: "{text:\"Here\",color:\"blue\",bold:true,clickEvent:{action:\"run_command\",value:\"/setblock ... redstone_block\"}}",
        Text4: "{text:\" /\\\ \",color:\"gold\",bold:true}"
    },
    display: {Name: "Custom Sign"}
}

It's almost the same if you want to do it with a /setblock or /blockdata command.




Pictures about "Stop command blocks on clock when sign clicked?"

Stop command blocks on clock when sign clicked? - Woman with paper with cross sign
Stop command blocks on clock when sign clicked? - Red Stop Sign
Stop command blocks on clock when sign clicked? - Black activist wearing Anonymous mask as sign of protest



How do you stop time with a command block?

How to Enter the Command
  • Open the Chat Window. The easiest way to run a command in Minecraft is within the chat window.
  • Type the Command. In this example, we are going to stop time from advancing with the following command: /gamerule doDaylightCycle false.




  • I figured out how to STOP TIME in MINECRAFT and YOU CAN TOO! (command block tutorial)




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

    Images: Anete Lusina, Anete Lusina, Pixabay, Anete Lusina