I'm working on a game kind of like dead by daylight in MC. I want them to have to stand next to something for an allotted time or press a button a certain amount of times but can't quite figure out how to do either. I don't need an answer to both so if anyone has an idea on how to do one of them that'd be great!
You create a dummy scoreboard that will count how many tick the player stood on the position
(once) : /scoreboard objectives add TimePassed
(every tick) : /scoreboard players add @a[x=0,y=0,z=0,distance=..1] Time Passed 1
(if you want the counter to reset if the player is not on the position) : /scoreboard reset @a[x=0,y=0,z=0,distance=1..] TimePassed
(every tick) : /execute as @a[scores={TimePassed=200}] run say "I stood 200 tick in there... So what now?"
I haven't test the code, so tell me if something is wrong.
I'm working on a game kind of like dead by daylight in MC. I want them to have to stand next to something for an allotted time or press a button a certain amount of times but can't quite figure out how to do either. I don't need an answer to both so if anyone has an idea on how to do one of them that'd be great!
All you need is to use scoreboard.
You create a dummy scoreboard that will count how many tick the player stood on the position
I haven't test the code, so tell me if something is wrong.
I like trains... OF CHAIN COMMAND BLOCKS !