Download Deltatime — Minecraft Mods — MetaMods

Deltatime

Active

Downloads

0

Last update

1 year ago

Versions

1.20 — 1.21
Server
Libraries
Game optimization
Utils

Deltatime Mod

Why Is This Important

  • This development works best when paired with the World Border Fix modification
  • Without the mentioned mod, you'll need to reduce the minimum world border diameter in the datapack itself to prevent accidental world border damage

Counter System and Its Principles

A specialized parameter named "deltatime" handles time measurement:

  • tickdelta → previous interval duration (defaults to milliseconds) with a maximum 10-second drift
  • tickstoadd → increments in current counter variables that remain consistent during server lag
  • accuracy ← determines timing granularity (1000 → milliseconds basis)
    • higher precision requires world border diameter adjustments

Practical Use of tickstoadd

Practical application 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 approach, "function my:action2" activates at target "untilaction objective" range, while "action1" runs one second earlier
  • Lag-proof timers increase increments when server performance drops
  • Calculations could skip both 0 or 20 thresholds
  • Your tracking needs require persistant pre-bonus time records; interpret earliest measure results vs current level difference

Internal Datapack Operations

  • Game borders follow real seconds, not cyclical game momentum
  • Chronological changes require updating border dimensions over rigid durations
  • Each frame compares with instant border position changes for timing verification
Project members
SmajloSlovakian

SmajloSlovakian

Developer

Created: 12 Apr 2024

ID: 25818