Create an clock called Temporal, that when you hit someone with it, the target slows, down as if the tick speed was slowed down, but it only affects them, not the user, also the command to get Temporal is /temporal
I’ll create a time-manipulation plugin featuring a special clock item that slows down targets when struck.
Created Temporal! The plugin includes:
Features:
Custom Temporal Clock item (Minecraft clock)
Slows targets with Slowness V + Mining Fatigue III
Particle effects (configurable cloud particles)
Permission-based access (
temporal.useandtemporal.give)Configurable effect duration and intensity
Command:
/temporal- Gives you the Temporal Clock (requirestemporal.givepermission)
How it works:
Get the clock with
/temporalHit another player with it (requires
temporal.usepermission)Target experiences extreme slowdown while you remain unaffected
Particles spawn around the victim showing the time distortion
All durations, effect levels, and messages are configurable in config.yml!
Instead of Effects, can you make it so tick speed slows down, SPECIFICALLY FOR THEM
I’ll remake this to actually slow down the player’s tick speed by manipulating their velocity, actions, and interactions frame-by-frame.
Also make it so targets are affect by temporal for 15 seconds, while the cooldown of temporal is 6 minutes
Done! Updated Temporal with:
Duration: Targets are now slowed for 15 seconds (300 ticks)
Cooldown: The Temporal Clock has a 6 minute cooldown (7200 ticks) between uses
The cooldown is per-player, so if you try to use it again before 6 minutes are up, you’ll see a message showing how many seconds remain. The cooldown tracks the attacker, not the victim, so multiple players with Temporal Clocks can each use theirs independently.
Make the texture of the clock, a normal clock, but the yellow is replaced with a dark blue, like really dark blue
I’ll set up the resource pack structure and custom model data for the Temporal Clock. However, I cannot create the actual PNG texture file (binary), so I’ll provide you with instructions on how to create it.
Done! I’ve set up the custom texture system for the Temporal Clock:
What I did:
Added
CustomModelData: 1001to the Temporal Clock itemCreated the resource pack structure with model overrides
Set up the custom model pointing to
temporal_clock.png
What you need to do: Since I cannot create binary PNG files, you need to create the texture:
Extract the default Minecraft clock texture (
clock_00.png) from your Minecraft jarEdit it - replace all yellow/gold pixels with dark blue (recommended:
#00143Cor RGB: 0, 20, 60)Save as:
src/main/resources/resourcepack/assets/minecraft/textures/item/temporal_clock.png
I’ve included detailed instructions in TEXTURE_INSTRUCTIONS.txt inside the resourcepack folder.
Once you create the texture, players will need to install the resource pack from the src/main/resources/resourcepack folder to see the custom dark blue clock!
for some reason, the server is really laggy and these errors keep popping up [09:12:01 WARN]: [Temporal] Task #10 for Temporal v1.0 generated an exception
I need to see the full error stack trace to diagnose the issue. Can you share the complete error message that appears after that warning line?
In the meantime, let me check the current code:
I see the issue! The task is running every single tick (20 times per second) and modifying player velocity constantly, which is causing massive lag. Let me optimize this:
Fixed the lag issue! The problem was the task running every single tick (20 times per second) and constantly modifying player velocity.
Changes made:
Task frequency reduced - Now runs every 5 ticks instead of every tick (80% less frequent)
Velocity modification moved - Only slows players when they actually move (in
PlayerMoveEvent), not 20 times per second regardlessTick countdown adjusted - Decrements by 5 each iteration to match the new task frequency
This should eliminate the lag completely while maintaining the time-slow effect. The 15-second duration and 6-minute cooldown remain the same!
32-c5eb079] at net.minecraft.server.dedicated.DedicatedServer.tickServer(DedicatedServer.java:427) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.processPacketsAndTick(MinecraftServer.java:1667) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1335) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:388) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] [09:12:01 WARN]: [Temporal] Task #10 for Temporal v1.0 generated an exception at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:474) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1589) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.dedicated.DedicatedServer.tickServer(DedicatedServer.java:427) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.processPacketsAndTick(MinecraftServer.java:1667) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1335) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:388) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] [09:12:01 WARN]: [Temporal] Task #10 for Temporal v1.0 generated an exception at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:474) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1589) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.dedicated.DedicatedServer.tickServer(DedicatedServer.java:427) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.processPacketsAndTick(MinecraftServer.java:1667) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1335) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:388) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] [09:12:01 WARN]: [Temporal] Task #10 for Temporal v1.0 generated an exception at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:474) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1589) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.dedicated.DedicatedServer.tickServer(DedicatedServer.java:427) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.processPacketsAndTick(MinecraftServer.java:1667) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1335) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:388) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] [09:12:01 WARN]: [Temporal] Task #10 for Temporal v1.0 generated an exception at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:474) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1589) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.dedicated.DedicatedServer.tickServer(DedicatedServer.java:427) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.processPacketsAndTick(MinecraftServer.java:1667) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1335) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:388) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] [09:12:01 WARN]: [Temporal] Task #10 for Temporal v1.0 generated an exception at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:474) ~[paper-1.21.11.jar:1.21.11-132-c5eb079] maybe this will clear things up?
I need to see the actual exception type at the top of those stack traces. Can you scroll up and show me the line that says something like java.lang.NullPointerException or ConcurrentModificationException right before these stack traces?
However, I can already see the likely issue - the task is modifying the slowedPlayers map while iterating over it, or players are going offline while being tracked. Let me fix this:
I see the issue! The problem is on line 51 where entry.setValue(remainingTicks) is being called inside removeIf(), which causes a ConcurrentModificationException. You can’t modify entry values inside removeIf(). Let me fix this:
Fixed! The issue was that entry.setValue(remainingTicks) was being called inside removeIf(), which causes a ConcurrentModificationException.
The fix:
Now updates are collected in a temporary
toUpdatemap firstremoveIf()only handles removals (returning true/false)After
removeIf()completes, all updates are applied at once withputAll()
This eliminates the concurrent modification issue and should completely stop the lag and error spam. Restart your server and it should work smoothly now!
please shorten the cooldown to 2 minutes
package com.temporal.plugin;
import com.temporal.plugin.commands.TemporalCommand;
import com.temporal.plugin.listeners.TemporalListener;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class Temporal extends JavaPlugin {
private TemporalListener temporalListener;
@Override
public void onEnable() {
saveDefaultConfig();
getCommand("temporal").setExecutor(new TemporalCommand(this));
temporalListener = new TemporalListener(this);
getServer().getPluginManager().registerEvents(temporalListener, this);
getLogger().info("Temporal has been enabled!");
}
@Override
public void onDisable() {
if (temporalListener != null) {
temporalListener.stopTickTask();
}
getLogger().info("Temporal has been disabled!");
}
}