While I was playing with some redstone tried to make a money system to sell iron. However when I power the command block with a button, the comparator after it stays on.

the command being run is:

/clear @p minecraft:iron_ingot 0 5 

and then a comparator leads to:

/scoreboard players add @p Dollars 10

So how do I turn off the comparator?

  • 2
    I'm pretty sure comparators output based on the successful command count, not whether a particular command was successful. – angussidney Jun 18 '15 at 6:34
  • There isn't a good way to "turn off" a comparator. The command block still has a success value until it fails. – vpzomtrrfrt Jun 18 '15 at 22:02
  • See my answer here: gaming.stackexchange.com/questions/220548/… – user112881 Jun 23 '15 at 15:41

If the command returns successful, a blockdata value called SucessCount is true, and until the command returns false, it will remain true. So along with the /scoreboard command, run /blockdata [Command block X Y Z] {SucessCount:0} and /setblock [Comparator X Y Z] unpowered_comparator

| improve this answer | |

have you tried scoreboard? I would do: /scoreboard players set @p sell 1 On A Fill Clock /clear @p[score_sell_min=1] iron_ingot 0 5 /scoreboard objectives add @p[score_sell_min=1] Dollars 10 /scoreboard players set @p[score_sell_min=1] sell 0 Hopefully that would work. I havnt tried it but i wish you luck

| improve this answer | |
  • Please inform yourself to how formulate and format an answer on this site. An answer should not contain questions by temlselves and please keep formatting in mind. – k0pernikus Jun 19 '15 at 21:59
  • 1
    It's generally a good idea to test a command before you post it here. We prefer answers that solve the problem, not just guess at it. – Frank Jun 19 '15 at 21:59
  • @TML Please take the tour: gaming.stackexchange.com/tour – k0pernikus Jun 19 '15 at 22:00

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