guardianj8

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

Kodari AI
KodariJun 25 at 6:57 am 6

I’ll create a time-manipulation plugin featuring a special clock item that slows down targets when struck.

Temporal
A time-manipulation plugin featuring the Temporal clock item. When a player strikes another player with this mystical clock, the target experiences time slowing down around them through slowness and mining fatigue effects, while the wielder remains unaffected. Includes particle effects and configurable slow durations. Players with permission can obtain the Temporal clock via the /temporal command.

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.use and temporal.give)

  • Configurable effect duration and intensity

Command:

  • /temporal - Gives you the Temporal Clock (requires temporal.give permission)

How it works:

  1. Get the clock with /temporal

  2. Hit another player with it (requires temporal.use permission)

  3. Target experiences extreme slowdown while you remain unaffected

  4. Particles spawn around the victim showing the time distortion

All durations, effect levels, and messages are configurable in config.yml!

guardianj8

Instead of Effects, can you make it so tick speed slows down, SPECIFICALLY FOR THEM

Kodari AI
KodariJun 25 at 7:03 am 19

I’ll remake this to actually slow down the player’s tick speed by manipulating their velocity, actions, and interactions frame-by-frame.

guardianj8

Also make it so targets are affect by temporal for 15 seconds, while the cooldown of temporal is 6 minutes

Kodari AI
KodariJun 25 at 7:07 am 8

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.

guardianj8

Make the texture of the clock, a normal clock, but the yellow is replaced with a dark blue, like really dark blue

Kodari AI
KodariJun 25 at 7:15 am 9

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: 1001 to the Temporal Clock item

  • Created 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:

  1. Extract the default Minecraft clock texture (clock_00.png) from your Minecraft jar

  2. Edit it - replace all yellow/gold pixels with dark blue (recommended: #00143C or RGB: 0, 20, 60)

  3. 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!

guardianj8

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

Kodari AI
KodariJun 25 at 9:13 am 9

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:

  1. Task frequency reduced - Now runs every 5 ticks instead of every tick (80% less frequent)

  2. Velocity modification moved - Only slows players when they actually move (in PlayerMoveEvent), not 20 times per second regardless

  3. Tick 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!

guardianj8

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?

Kodari AI
KodariJun 25 at 9:14 am 6

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 toUpdate map first

  • removeIf() only handles removals (returning true/false)

  • After removeIf() completes, all updates are applied at once with putAll()

This eliminates the concurrent modification issue and should completely stop the lag and error spam. Restart your server and it should work smoothly now!

guardianj8

please shorten the cooldown to 2 minutes

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
11 498
src/main/java/com/temporal/plugin/Temporal.java
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!");
    }
}