I'm new to command blocks and I was watching this garage door tutorial which uses the following command to implement a T Flip Flop, i.e. it alternates between success and failure upon each activation:
testforblock ~ ~ ~ minecraft:command_block -1 {SuccessCount:0}
However, I'm using Minecraft 1.16.5 - I'm aware that testforblock
was removed in Minecraft 1.13 and onwards in favour of execute if
.
I tried the following:
execute if block ~ ~ ~ minecraft:command_block{SuccessCount:0}
However this seems to result in continuous success, due to the missing . edit: dataValue
(set to -1
) in the original command-1
is the same as not specifying anything according to the wiki
The following doesn't work due to a syntax error:
execute if block ~ ~ ~ minecraft:command_block -1 {SuccessCount:0}
How can I implement a T Flip Flop using a command block in Minecraft Java Edition versions 1.13 and newer?