q2xcs

Can you make me a plugin that flags the player if they place redstone repeator and redstone very fast like no delay like if they place that item conintuesly it alert the staff with OP with the user placing it

Kodari AI
KodariApr 14 at 11:12 am 7,625 (v2)

I’ll create a staff alert plugin that detects rapid redstone component placement.

RedstoneAlert
A staff alert plugin that detects and flags players who rapidly place redstone components. Monitors placement speed of redstone repeaters, redstone dust, and other configurable blocks. Alerts staff members with OP permissions when suspicious rapid placement is detected. Includes configurable thresholds, timing windows, and alert cooldown to prevent spam. Features reload command and customizable alert messages.

Plugin created! RedstoneAlert monitors rapid redstone component placement and alerts staff with OP permissions when players exceed the configured threshold. Features configurable materials list, placement thresholds, time windows, alert cooldowns, and a reload command.

q2xcs

Can you make the plugin support hex code

Kodari AI
KodariApr 14 at 1:00 pm 4,203 (v2)

I’ll read the existing files to understand the current color code handling and add hex code support.

I’ll add hex code support by creating a ColorUtil class and updating the color handling throughout the plugin.

Hex code support added! The plugin now supports both legacy color codes (&c, &a, etc.) and hex colors in two formats: &#RRGGBB (e.g., &#ff5555) and &{#RRGGBB} (e.g., &{#ff5555}). Updated the default alert message in config.yml to demonstrate hex colors.

q2xcs

can you also add it to alerts amor stands placed, and mosted amor standed placed also use discord webhook to alert staff thru discord too

Kodari AI
KodariApr 23 at 4:06 am 9,475 (v2)

I’ll add armor stand detection, tracking for most armor stands placed, and Discord webhook alerts.

Plugin updated with armor stand detection, total placement tracking, and Discord webhook alerts! Configure the webhook URL in config.yml to enable Discord notifications for both redstone and armor stand alerts.

q2xcs

Optimize the plugin so it won't lag to much and the plugin version is 1.1 now and use this has the config.yml

📎 1 file 1,245 chars
📄
pasted-code-1776918495718.txt
txt 35 lines
▶
enabled: true

check-interval-ms: 5000

placement-threshold: 10

alert-cooldown-seconds: 30

checked-materials:
  - REPEATER
  - REDSTONE_WIRE
  - REDSTONE_BLOCK
  - COMPARATOR
  - REDSTONE_TORCH

alert-message: "?c3ff&lᴀʟᴇʀᴛ &8- ?c3ff{player} &fis rapidly placing redstone components! ?c3ff({count} placements in {time}s)"

alert-sound: "ENTITY_EXPERIENCE_ORB_PICKUP"

armor-stand-check:
  enabled: true
  placement-threshold: 15
  check-interval-ms: 5000
  alert-cooldown-seconds: 30
  alert-message: "?c3ff&lᴀʟᴇʀᴛ &8- ?c3ff{player} &fis rapidly placing armor stands! ?c3ff({count} placements in {time}s) ?c3ff[Total: {total}]"

discord-webhook:
  enabled: false
  url: "https://discord.com/api/webhooks/1466738127778611283/ewpvhGchAj3Q0cczCuESvWkZfv1GDiuPSJpOExhbupyB5-T-nqOldYYCurOsbvUsHKET"
  username: "RedstoneAlert"
  avatar-url: ""
  embed-color: "#ff5555"
  send-armor-stand-stats: true
  message: "?c3ff&lᴀʟᴇʀᴛ &8- ?c3ff{player} &fis rapidly placing redstone components! ?c3ff({count} placements in {time}s)"
  armor-stand-message: "?c3ff&lᴀʟᴇʀᴛ &8- ?c3ff{player} &fis rapidly placing armor stands! ?c3ff({count} placements in {time}s) ?c3ff[Total: {total}]"
Kodari AI
KodariApr 23 at 4:30 am 13,152 (v2)

I’ll optimize the plugin for better performance and update it to version 1.1 with the new config.

Plugin optimized for v1.1! Key improvements:

  • ConcurrentHashMap for thread-safe tracking without locking

  • Config caching - values loaded once, O(1) Set lookup for materials instead of O(n) List iteration

  • Automatic cleanup task - runs every 60 seconds async to remove stale entries

  • Optimized listeners - ignoreCancelled=true, reduced string operations

  • Better Discord webhooks - CompletableFuture for true async, connection timeouts, color stripping

  • Memory management - clear() methods on disable, computeIfAbsent for atomic operations

  • Updated to config v1.1 with your exact settings

q2xcs

in the webhook send it using embed and user and etc.

Kodari AI
KodariApr 23 at 4:40 am 4,242 (v2)

I’ll update the Discord webhook to send proper embeds with user information and detailed fields.

Updated the Discord webhook to send rich embeds! Now includes:

  • Proper embed structure with title, description, and colored sidebar

  • Organized fields for Player, Placements, Time, Total (armor stands), and Server

  • Username and avatar customization from config

  • Thumbnails (redstone dust or armor stand image)

  • Footer with plugin version

  • Timestamp for when the alert occurred

  • Color support parsing hex colors to Discord decimal format

The alerts will now appear as professional Discord embeds with all the information neatly organized!

q2xcs

Can you also add like flags most amor stand placed also alert staff, and switch the op only can be alerted add permission to get alerted like staff and also use the webhook too, and optimize the plugin

Kodari AI
KodariApr 25 at 11:21 am 54,742 (v2)

I’ll add a leaderboard tracking system for most armor stands placed, switch to permission-based alerts, and optimize further.

I’ll add permission-based alerts, leaderboard tracking with flags for most armor stands placed, webhook support for leaderboards, and optimize the plugin.

Plugin fully optimized with all requested features! Here’s what was added:

✅ Armor Stand Leaderboard System:

  • Tracks total armor stands placed per player

  • /redstonealert flags or /redstonealert top to view top 10 placers

  • Automatic Discord webhook updates (configurable interval)

  • Sorted leaderboard with rankings

✅ Permission-Based Alerts:

  • Replaced OP-only checks with redstonealert.alerts permission

  • Staff with this permission receive in-game alerts

  • redstonealert.admin for reload/leaderboard commands

  • Permission caching for optimal performance

✅ Discord Webhook Enhancements:

  • Leaderboard embeds sent automatically to Discord

  • Rich formatting with player rankings

  • Configurable update intervals (default: 60 minutes)

✅ Performance Optimizations:

  • Permission caching to avoid repeated lookups

  • Efficient leaderboard sorting with streams

  • Async Discord webhook calls

  • Minimal memory footprint with ConcurrentHashMap

  • Automatic cleanup tasks for stale data

Config additions:

  • leaderboard.enabled - Enable/disable leaderboard tracking

  • leaderboard.top-count - Number of top players to show (default: 10)

  • leaderboard.webhook-update - Auto-send to Discord

  • leaderboard.webhook-interval-minutes - How often to update (default: 60)

  • server-name - Server name shown in Discord embeds

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
15 924
src/main/java/com/redstonealert/RedstoneAlert.java
package com.redstonealert;

import com.redstonealert.command.ReloadCommand;
import com.redstonealert.listener.ArmorStandListener;
import com.redstonealert.listener.PlacementListener;
import com.redstonealert.manager.ArmorStandTracker;
import com.redstonealert.manager.ConfigManager;
import com.redstonealert.manager.DiscordWebhook;
import com.redstonealert.manager.PlacementTracker;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;

@Getter
public final class RedstoneAlert extends JavaPlugin {

    private ConfigManager configManager;
    private PlacementTracker placementTracker;
    private ArmorStandTracker armorStandTracker;
    private DiscordWebhook discordWebhook;
    private BukkitTask cleanupTask;
    private BukkitTask leaderboardTask;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.configManager = new ConfigManager(this);
        this.placementTracker = new PlacementTracker(this);
        this.armorStandTracker = new ArmorStandTracker(this);
        this.discordWebhook = new DiscordWebhook(this);

        getServer().getPluginManager().registerEvents(new PlacementListener(this), this);
        getServer().getPluginManager().registerEvents(new ArmorStandListener(this), this);

        getCommand("redstonealert").setExecutor(new ReloadCommand(this));

        startCleanupTask();
        startLeaderboardTask();

        getLogger().info("RedstoneAlert v1.1 has been enabled!");
    }

    @Override
    public void onDisable() {
        if (cleanupTask != null) {
            cleanupTask.cancel();
        }
        if (leaderboardTask != null) {
            leaderboardTask.cancel();
        }
        
        placementTracker.clear();
        armorStandTracker.clear();
        
        getLogger().info("RedstoneAlert has been disabled!");
    }

    private void startCleanupTask() {
        cleanupTask = Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
            placementTracker.cleanup();
            armorStandTracker.cleanup();
        }, 1200L, 1200L);
    }

    public void restartCleanupTask() {
        if (cleanupTask != null) {
            cleanupTask.cancel();
        }
        startCleanupTask();
    }

    private void startLeaderboardTask() {
        if (!configManager.isLeaderboardEnabled() || !configManager.isLeaderboardWebhookUpdate()) {
            return;
        }
        
        long intervalTicks = configManager.getLeaderboardWebhookIntervalMinutes() * 60L * 20L;
        leaderboardTask = Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
            if (configManager.isDiscordWebhookEnabled()) {
                discordWebhook.sendLeaderboardUpdate(
                    armorStandTracker.getTopPlacers(configManager.getLeaderboardTopCount())
                );
            }
        }, intervalTicks, intervalTicks);
    }

    public void restartLeaderboardTask() {
        if (leaderboardTask != null) {
            leaderboardTask.cancel();
        }
        startLeaderboardTask();
    }
}