
DatapacksJava
Deltatime
Java data pack listed for Minecraft 1.21. Downloads from the MC Java Mods app on Android.
⬇ Download on ModrinthWARNING!
- this pack was designed to be used with Multi world border mod
- if you don't use this mod, you need to adjust the minimal diameter of the worldborder in the datapack (decreasing accuracy) to avoid getting unexpected worldborder damage
Scoreboard values
Scoreboard objective: deltatime
- tickdelta -> previous tick duration (defaultly in milliseconds) (maxes out at 10 seconds by default)
- tickstoadd -> number to add to a counter, which you don't want to be affected by lags (more info below on how to use it effectively)
- accuracy <- the accuracy of the timings (defaults to 1000 -> milliseconds)
- for even more accuracy, you need to edit this datapack's worldborder's minimal values
- for even even more accuracy, you need to use my mod with the same name
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
- In this example, we are trying to run "function my:action2" after "untilaction objective" ticks run and a "function my:action1" 1 second before it.
- If we want to make it independant of server performance, we need to add a larger number of ticks to the counter, if the server lags.
- This means that there is a possibility that the counter jumps over the 20 or 0.
- In order to prevent the actions from not executing, we need to have another variable, which tells us the tickcount before the tickstoadd get added (subtracted). Then we need to check if the previous count is higher than our desired value and the current count is exactly or less than our desired value.
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?
- worldborder in minecraft does not time itself based on ticks but on real seconds
- this makes it possible to calculate the time by changing the border's size with a set duration
- the next tick just get the border's size and calculate how much time passed based on how much has the border changed
Also check out the mod version for even better accuracy! (although even less maintained)
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.21
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Modrinth — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — see the MC Java Mods guides for the full walkthrough.
File checked by MCModsHub
- Downloads as Minecraft-DeltaTime-Datapack.zip
- Download size: 51 KB
- Download link checked 2 Nov 2026 — working
These come from our own check of the pack file, not from the source page.