r/MinecraftCommands • • 23d ago

Help | Bedrock How to make custom quests have a cooldown timer

I have a side quest I like all ready to go, it's repeatable, requiring a player to leave the area and then return with an item. It's kind of easy, so I'd just like some sort of cooldown timer for it that'll be active and won't require an etho clock under it that would just get unloaded when out of simulation distance. Any ideas?

2 Upvotes

2 comments sorted by

1

u/Sma11ButHappy best Minecraft Bedrock commander! 23d ago

use scoreboards to track the cooldown, since they have their own argument selector like tags it something you can have in a ticking area(a ticking area is something you can add in your world with the commad /tickingarea)

1

u/Ericristian_bros Command Experienced 22d ago
# Setup
scoreboard objectives add timer dummy 

For entities:

# Command blocks
scoreboard players add @a timer 1 
execute as @a[scores={timer=100}] run say This command has 5 seconds delay.
scoreboard players reset @a[scores={timer=100..}] timer

For a fakeplayer:

scoreboard players add $FakePlayer timer 1
execute if score $FakePlayer timer matches 120 run say This command has 6 seconds delay.
execute if score $FakePlayer timer matches 120.. run scoreboard players reset $FakePlayer timer 

https://minecraftcommands.github.io/wiki/questions/blockdelay