HomeJavaDatapacksDeltatime
Deltatime
DatapacksJava

Deltatime

by SmajloSlovakian · on Modrinth

Keep track of the real time even on laggy servers (uses the worldborder method). Free Minecraft Java datapack for 1.21.

⬇ Download on Modrinth

WARNING!

Scoreboard values

Scoreboard objective: deltatime

How to use tickstoadd

example:

scoreboard players operation untilactionprev objective = untilaction objective
scoreboard players operation untilaction objective -= tickstoadd deltatime
execute if score untilaction objective matches ..20 unless score untilactionprev objective matches ..20 run function my:action1
execute if score untilaction objective matches ..0 unless score untilactionprev objective matches ..0 run function my:action2

If you just want to time one action, you can just check for ..0 without the helper variable

(note that if you set the counter to a lower/higher (according to the direction of counting) value while the counter is counting and you won't also change the previous count, it will execute everything in between the previous and current value)

How does the datapack work?

Also check out the mod version for even better accuracy! (although even less maintained)

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more