I've already got the "detecting if the player is near a certain block if near it" in control using tons of detect execute commands and 6 repeating command blocks
(execute @p ~ ~ ~ detect ~(-X and X) ~(-Y and Y) ~(-Z and Z) minecraft:observer 0 scoreboard players set @p WallJump 1)
When it goes near an Observer, the WallJump score will be set to 1, but I have NO clue on how to set it to 0 automatically after you leave the range. Any leads?
In a nutshell, how do you activate a certain command block if a group of certain command blocks fail?
Set everyone's score to 0 at the start of the chain, then when all the commands run, the player will eather get a score of 1 or stay at 0.
scoreboard players reset @a near_obs
execute @a ~ ~ ~ detect ~ ~ ~1 minecraft:observer 0 scoreboard players set @s near_obs 1
... rest of the detecting commands..
execute @a[score_near_obs_min=1] ~ ~ ~ say score = 1
execute @a[score_near_obs=0] ~ ~ ~ say score = 0
Written by AboookhTheMaster,
Feel free to ask anything.
----|Have a nice day!|----