Deltatime
Expand Datapack Capabilities in Minecraft
This mod introduces special commands that grant datapacks access to vanilla game features previously unavailable for modification.
Core Features
The /deltatime command provides powerful tools for managing game mechanics:
- tickdelta — shows the duration of the previous tick in microseconds
- tickstoadd — increments a counter that remains stable even during server lag
- setitemcooldown
— sets cooldown time for items with animation similar to ender pearls - setability
— modifies player character abilities - setproperty
— configures various player parameters
Effective Use of tickstoadd
This function allows creating timers independent of server performance. Here's a practical implementation example:
execute store result score tickstoadd objective run deltatime tickstoadd
scoreboard players operation untilactionprevious objective = untilaction objective
scoreboard players operation untilaction objective -= tickstoadd objective
execute if score untilaction objective matches ..0 unless score untilactionp objective matches ..0 run function my:action
The system prevents action execution even during sudden server latency spikes.
Player Ability Management
Flying (flying)
- true — forced flight mode
- false — flight disable
Building Mode (instabuild)
- true — fast building mode
- false — creative restrictions
Invulnerability (invulnerable)
- true — complete damage protection
Building Permissions (mayBuild)
- Access to block placement in adventure mode
- Construction control capabilities
Additional Settings
- mayfly — flight mode switching
- flySpeed — flight speed
- walkSpeed — movement speed
Character Parameters
Direct access to core characteristics:
- Health (health)
- Saturation level (foodSaturationLevel)
- Hunger level (foodLevel)
- Exhaustion (foodExhaustionLevel)
Technical Features
- tickdelta includes time waiting for the next tick
- tickstoadd works correctly even with unstable performance
- Automatic boundary validation for acceptable values