How can I run chains after a /testfor command without having each additional command block being conditional to previous steps?
- Functions existed in 1.12 already, so you could make the command block run a function.
- You could place a redstone block at another repeating command block chain or set the first one to
auto:1
, but that would only execute the commands there one tick later. Make any command in that chain to remove the redstone block or tag again to make it not loop forever. - You can use something similar to 1.13's
/execute if
syntax in 1.12 already. For example in your example the commands would be these (and this can also be used for NBT checks):
scoreboard players set @a[x=0,y=1,z=0,r=.4] foo 1 {SomeNBT:true}
execute @a[foo_min=1] ~ ~ ~ setblock 0 0 0 air
execute @a[foo_min=1] ~ ~ ~ tellraw @a {"text":"[@] False floor trap! LOL"}
scoreboard players set @a foo 0
As you can see, I changed the /say
to a /tellraw
, because doing it this way always changes the executor and the execution position away from the command block. That's just a downside of 1.12 and one of the reasons why /execute
was overhauled in 1.13.