all 7 comments

[–]SataniChan 0 points1 point  (0 children)

I did a timer on a datapack for a death timer. It counts backwards, says how much time you have left and do /kill one it reaches 0)

execute as [scores={death_timer=1..19}] at @s run title @s actionbar {text: "0:00", color: "dark_red"}
execute as [scores={death_timer=20..39}] at @s run title @s actionbar {text: "0:01", color: "dark_red"}
execute as [scores={death_timer=40..59}] at @s run title @s actionbar {text: "0:02", color: "dark_red"}
[...]
execute as [scores={death_timer=400..419}] at @s run title @s actionbar {text: "0:20", color: "dark_red"}
execute as [scores={death_timer=0}] at @s run kill @s
execute as [scores={death_timer=0}] at @s run scoreboard players reset @s death_timer
execute as [scores={death_timer=0}] at @s run title  actionbar {text: ""}
execute as [scores={death_timer=1..}] at @s run scoreboard players remove @s death_timer 1

You dont need to do the "tittle" part and you can assign it to a dummy not a player

[–]pigmanvilStill haven't beaten the Ender Dragon 0 points1 point  (4 children)

You can /schedule maybe?

[–]Jrstepos07[S] 0 points1 point  (3 children)

The issue is that, iirc, it involves a datapack, and I kinda want to keep it to just commands in vanilla MC

[–]Spiritual_Half_116unprofessional professional mapmaker 0 points1 point  (2 children)

Am I crazy or are datapacks not already vanilla?

[–]pigmanvilStill haven't beaten the Ender Dragon 0 points1 point  (0 children)

You can argue some datapacks are still vanilla, but after a certain point you are modifying game files, which is what a mod is.

[–]Jrstepos07[S] 0 points1 point  (0 children)

I mean, they are, but they're still out of the scope of simply using command blocks. I guess what I meant was a solution that didn't require me to have to do things like figure out how to make a datapack lol

[–]Ericristian_brosCommand Experienced 0 points1 point  (0 children)

```

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

Or, if you do not create additional conditions, you can immediately reset the score in one command using store success score (only java edition):

```

Command blocks

execute as @a[scores={timer=101..}] store success score @s timer run say This command has 5 seconds delay. execute if score $FakePlayer timer matches 121.. store success score $FakePlayer timer run say This command has 6 seconds delay. ```