ModsJava
TickTime
Java mod listed for Minecraft 1.14–1.15. Downloads from the MC Java Mods app on Android.
⬇ Download on SpigotDid you know that measuring time in seconds could lead to unfair disadvantages?
Do you want to use TickTime too? Drag-and-drop into your project and use it like this:
I don't even need to put the code in GitHub. (The author would like to tell you that he doesn't even know how to use GitHub, that noob)
General Information:
- Be poor Steve, playing in a minigame with a time limit, who lost because the server lagged constantly and they lost 5 seconds, which could have saved the match.
- Be Sally, who cannot have a consistent 1:1 time measurement in her world because Minecraft ticks, (while they're mostly every 1/20 of a second) they're inconsistent due to lag.
Every time Minecraft thinks time has passed, TickTime will too.
TickTime has no commands, no permissions and no events, so just drag-and-drop into your plugins folder. Because TickTime only uses two imports (that every spigot.jar has) it is essentially version-independent.
Do you want to use TickTime too? Drag-and-drop into your project and use it like this:
Code (Java):
long time0
= TickTime.
currentTickTime
(
)
;
letsMakeSomeCode ( ) ;
long time1 = TickTime. currentTickTime ( ) ;
// calculate time between ticks!
long time_taken = time1 - time0 ;
// 1 second = 20 mc ticks
long seconds = time_taken / 20 ;
letsMakeSomeCode ( ) ;
long time1 = TickTime. currentTickTime ( ) ;
// calculate time between ticks!
long time_taken = time1 - time0 ;
// 1 second = 20 mc ticks
long seconds = time_taken / 20 ;
Spoiler
Code (Java):
package
dev.ckitty.mc.ticktime
;
import org.bukkit.plugin.java.JavaPlugin ;
import org.bukkit.scheduler.BukkitRunnable ;
public class TickTime extends JavaPlugin {
private static long TICK_TIME ;
public static long currentTickTime ( ) {
return TICK_TIME ;
}
private Timer timer ;
@Override
public void onEnable ( ) {
timer = new Timer ( ) ;
timer. runTaskTimerAsynchronously ( this , 0 , 1 ) ;
}
@Override
public void onDisable ( ) {
timer. cancel ( ) ;
timer = null ;
}
private class Timer extends BukkitRunnable {
@Override
public void run ( ) {
TICK_TIME ++;
}
}
}
import org.bukkit.plugin.java.JavaPlugin ;
import org.bukkit.scheduler.BukkitRunnable ;
public class TickTime extends JavaPlugin {
private static long TICK_TIME ;
public static long currentTickTime ( ) {
return TICK_TIME ;
}
private Timer timer ;
@Override
public void onEnable ( ) {
timer = new Timer ( ) ;
timer. runTaskTimerAsynchronously ( this , 0 , 1 ) ;
}
@Override
public void onDisable ( ) {
timer. cancel ( ) ;
timer = null ;
}
private class Timer extends BukkitRunnable {
@Override
public void run ( ) {
TICK_TIME ++;
}
}
}
General Information:
- The values given by TickTime.currentTickTime() are not consistent after the server stopping, but they are after the /reload command.
- You shouldn't worry that the TICK_TIME variable could overflow. Even System.nanotime() won't overflow in at least two years of non-stop use. So, try to restart your server every few days.
- Tips, suggestions, features? Please feel free to ask them in the discussion and not in the reviews. You cannot communicate very well in the reviews...
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.14, 1.15
- 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 Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
TickTime is a free Minecraft Java mod. Compatible with Minecraft 1.14, 1.15. Downloaded 310 times (via Spigot). Download it and open it directly in the game.