insann0491_40243
📎 1 file 4,629 chars
📄
pasted-code-1772774978383.txt
txt 291 lines
▶
SecurePlayerEvidence (Advanced SMP Security Logger)

Create a Minecraft Paper / Spigot plugin named SecurePlayerEvidence for Minecraft version 1.21.11.

The plugin is designed for private SMP servers with whitelist enabled.
Its purpose is to collect strong evidence about every player activity and send it to a private Discord logging system so admins can investigate griefing, bullying, cheating, or suspicious behavior.

This plugin must be secure, lightweight, and reliable.

Main Concept

Whenever a player joins the server, the plugin should:

Identify the player using UUID, IP, and username.

Send detailed information to Discord through a webhook.

Create a dedicated logging thread or section for that player.

Continuously log their activity while they are online.

All logs must be stored both:

in Discord

in local server files

This ensures evidence is never lost.

Important Privacy Rule

Players must NEVER see these logs.

Requirements:

Logs are sent to Discord webhook only

Discord channel must be admin-only

Players have no access to logs

Plugin must not send any messages to players

All logging is silent and invisible to players.

Discord Logging System

The plugin must support Discord Webhooks.

Admin config example:

discord-webhook: "WEBHOOK_URL"
discord-category: "player-evidence"

When a player joins:

Create a Discord thread inside the category.

Thread example:

player-Phantom_Warrior

All logs related to that player go inside this thread.

Player Identity Tracking

The plugin must track the following player information.

Basic Information
Username
UUID
IP Address
First Join Date
Join Time
Client Brand
Ping
Game Mode

Example message:

Player Joined

Username: Phantom_Warrior
UUID: 9b3a8d3a-xxxx
IP Address: 192.168.xxx
Join Time: 2026-03-06
Client: Vanilla
Ping: 42ms
Location Evidence System

Every important location must be logged.

Join Location
World: world
X: 123
Y: 64
Z: -245
Leave Location
World: world
X: 400
Y: 70
Z: -322
Death Location
Death Location
World: world
X: 420
Y: 65
Z: -315
Cause: PvP
Block Activity Logging

Record when a player modifies the world.

Block Placement
Block Placed
Type: Diamond_Block
Location: 120 64 -200
Block Break
Block Broken
Type: Chest
Location: 118 63 -198

This helps detect base griefing.

PvP Combat Logging

When a player attacks another player:

PvP Attack

Attacker: Phantom_Warrior
Victim: AliMeer
Weapon: Diamond Sword
Location: 200 64 -300

This helps detect bullying or harassment.

Command Logging

Log every command the player uses.

Example:

Command Used

Player: Phantom_Warrior
Command: /tpa
Time: 12:35
Suspicious Behavior Detection

The plugin must include automatic security alerts.

Alt Account Detection

If multiple players join from the same IP:

⚠ Alt Account Detected

Players:
Phantom_Warrior
DarkKnight

IP: 192.168.xxx
Name Change Detection

If UUID matches but name changed:

⚠ Username Changed

Old Name: ShadowPvP
New Name: DarkKnight
UUID: xxxxx
Unauthorized Join Attempts

If a player tries joining but is not whitelisted:

⚠ Unauthorized Join Attempt

Username: UnknownPlayer
IP: xxx.xxx.xxx.xxx
Time: 14:32
Grief Detection System

If a player breaks many blocks quickly, log a warning.

Example:

⚠ Possible Griefing

Player: Phantom_Warrior
Blocks broken: 40
Time: 15 seconds
Location: 200 65 -210
Base Coordinate Evidence

If a player repeatedly visits the same coordinates, record it.

Example:

Frequent Location Detected

Player: Phantom_Warrior
Location: 450 70 -320
Visits: 12 times

This helps detect base scouting.

Inventory Evidence System

Log rare item possession.

Example:

Rare Item Detected

Player: Phantom_Warrior
Item: Netherite Sword
Enchantments: Sharpness V
Anti Hack Alerts

Detect suspicious behavior.

Examples:

Speed Hack Alert
⚠ Suspicious Movement Speed

Player: Phantom_Warrior
Speed: 0.75
Kill Aura Suspicion
⚠ Rapid PvP Hits

Player: Phantom_Warrior
Hits: 8 hits in 2 seconds
Discord Message Format

All messages should be Discord embeds with:

Player name

timestamp

coordinates

event type

color indicators

Example colors:

Green → join

Yellow → warning

Red → suspicious activity

Local File Backup

All logs must also be saved locally.

Folder structure:

plugins/SecurePlayerEvidence/

Files:

players.yml
activity_logs.yml
security_alerts.yml

This ensures evidence exists even if Discord fails.

Admin Commands
/evidence reload
/evidence player 
/evidence ip 
/evidence alerts
Performance Requirements

The plugin must:

use asynchronous logging

avoid server lag

support large SMP servers

store data efficiently

Plugin Name
SecurePlayerEvidence
Kodari AI
KodariMar 6 at 5:33 am 21,906 (v2)

I’ll plan this plugin carefully before writing:

  • 14 Java classes covering: main plugin, config, Discord webhook (async queue), embed builder, player data, player/security/storage managers, 5 event listeners, and command handler

  • Discord: HTTP webhook calls with embed JSON, thread-name support for forum channels, queued async sender to respect rate limits

  • Local storage: per-player .log files + players.yml + security_alerts.yml

  • Security: alt detection, name change tracking, grief threshold, speed monitoring, kill-aura hit tracking, whitelist bypass logging

SecurePlayerEvidence
An advanced SMP security logging plugin for Paper/Spigot 1.21.1. Silently tracks every player action including joins, block activity, PvP, commands, and movement, then sends rich Discord embeds via configurable webhooks. Features automatic security alerts for alt accounts, name changes, unauthorized joins, griefing, speed hacks, and kill-aura suspicion. All evidence is also stored locally in per-player log files and YAML files to ensure data persistence even if Discord is unavailable.

SecurePlayerEvidence is now fully built with 14 Java classes covering all requested features: async Discord webhook embeds with rate-limit protection, per-player .log file backups, players.yml + security_alerts.yml storage, join/quit/block/combat/command/movement event logging, and automatic security alerts for alt accounts, name changes, unauthorized joins, griefing, speed hacks, and kill-aura — all completely silent to players with admin-only /evidence commands.

insann0491_40243

tell how to setup this plugin in my server step by step guid

Kodari AI
KodariMar 6 at 5:35 am 7,555 (v2)

Let me read the project files to understand the plugin fully before giving you a setup guide.

Here is a complete, step-by-step setup guide for SecurePlayerEvidence:


🛡️ SecurePlayerEvidence — Server Setup Guide


📋 Requirements

Requirement
Details
Minecraft Server
Spigot or Paper 1.21+
Java
Java 17 or newer
Discord Server
Required for webhook alerts
Permission
A permissions plugin (LuckPerms recommended) or default OP

⚙️ Step 1 — Build the Plugin JAR

If you already have a pre-built .jar, skip to Step 2.

  1. Make sure Java 17+ and Gradle are installed on your machine.

  2. Open a terminal in the project’s root folder (where build.gradle is).

  3. Run the build command:

    Plain Text
    ./gradlew build
    

    (On Windows use gradlew.bat build)

  4. The compiled .jar file will appear at:

    Plain Text
    build/libs/SecurePlayerEvidence-1.0.0.jar
    

📂 Step 2 — Install the Plugin

  1. Copy the .jar file into your server’s plugins/ folder.

  2. Start (or restart) your server once to let the plugin generate its config files:

    Plain Text
    plugins/
    └── SecurePlayerEvidence/
        ├── config.yml       ← main config (auto-generated)
        └── data/            ← player data & local logs (auto-generated)
    
  3. Stop the server immediately after the first start so you can configure it.


🔗 Step 3 — Create a Discord Webhook

  1. Open your Discord server.

  2. Go to the channel where you want to receive security alerts.

  3. Click the ⚙️ gear icon → Integrations → Webhooks → New Webhook.

  4. Give it a name (e.g. SecurePlayer Alerts) and optionally set an avatar.

  5. Click Copy Webhook URL — it looks like:

    Plain Text
    https://discord.com/api/webhooks/1234567890/XXXXXXXXXXXXXXX
    
  6. Keep this URL ready for the next step.

Optional Forum Thread Support: If you want alerts posted as Forum threads (one thread per player), use a Forum channel instead of a regular text channel, then set discord-forum-channel: true in the config.


🛠️ Step 4 — Configure config.yml

Open plugins/SecurePlayerEvidence/config.yml and fill in your values:

YAML
# ─────────────────────────────────────────────
# PASTE your Discord webhook URL here
# ─────────────────────────────────────────────
discord-webhook: "https://discord.com/api/webhooks/YOUR/WEBHOOK"

# Set to true if the webhook points to a Forum channel
# (creates a new thread per player instead of posting in one channel)
discord-forum-channel: false

# ─────────────────────────────────────────────
# GRIEF DETECTION
# Triggers if a player breaks X blocks in Y seconds
# ─────────────────────────────────────────────
grief-threshold:
  blocks: 40       # number of blocks broken
  seconds: 15      # within this many seconds

# How many times a player must visit the same location
# before it is flagged as suspicious
location-visit-threshold: 5

# ─────────────────────────────────────────────
# ANTI-HACK DETECTION
# ─────────────────────────────────────────────
anti-hack:
  speed-threshold: 0.65   # movement speed above this is flagged
  kill-aura-hits: 8       # hits within the time window to flag kill-aura
  kill-aura-seconds: 2    # time window in seconds

# ─────────────────────────────────────────────
# RARE ITEMS — picking these up/using them gets logged
# Add or remove Minecraft material names as needed
# ─────────────────────────────────────────────
rare-items:
  - NETHERITE_SWORD
  - NETHERITE_AXE
  - NETHERITE_PICKAXE
  - NETHERITE_HOE
  - NETHER_STAR
  - ELYTRA
  - TOTEM_OF_UNDYING
  - END_CRYSTAL

# ─────────────────────────────────────────────
# LOGGING TOGGLES — turn off anything you don't need
# ─────────────────────────────────────────────
log-commands: true    # logs commands players run
log-blocks: true      # logs block break/place activity
log-movement: true    # logs movement for speed/location checks

Save the file when done.


▶️ Step 5 — Start Your Server

Start your server normally. You should see this in the console:

Plain Text
[SecurePlayerEvidence] SecurePlayerEvidence enabled.

If you see errors, check Step 6 — Troubleshooting below.


🔐 Step 6 — Set Up Permissions

The plugin uses one permission node:

Permission
Description
Default
secureplayer.admin
Access to all
/evidence
commands
OP only

If you use LuckPerms, grant it to your staff:

Plain Text
/lp user <username> permission set secureplayer.admin true
/lp group admin permission set secureplayer.admin true

If you use plain OP, it works automatically — no extra setup needed.


💬 Step 7 — Learn the Commands

All commands require the secureplayer.admin permission.

Command
What it does
/evidence reload
Reloads
config.yml
without restarting the server
/evidence player <name>
Shows all logged evidence for a specific player
/evidence ip <address>
Looks up all players associated with an IP address
/evidence alerts
Displays the latest security alerts in chat

✅ Step 8 — Verify It’s Working

  1. Join your server with an alt account or test account.

  2. Break 40+ blocks rapidly (within 15 seconds) to trigger grief detection.

  3. Check your Discord channel — you should receive an embed alert within seconds.

  4. Run /evidence player <yourname> in-game and confirm log entries appear.


🔄 Making Config Changes Later

After editing config.yml, you do not need to restart the server. Simply run:

Plain Text
/evidence reload

🚨 Troubleshooting

Problem
Solution
No Discord alerts are arriving
Double-check the webhook URL in
config.yml
— make sure there are no extra spaces or quotes missing
[SecurePlayerEvidence] enabled
not showing
Check the console for a red error; confirm the JAR is in
/plugins/
and the server is 1.21+
/evidence
says “Unknown command”
The server did not load the plugin — check
plugins/SecurePlayerEvidence/
exists
Players hitting many mobs at once flagged incorrectly
Raise
kill-aura-hits
or
kill-aura-seconds
in config to reduce false positives
Speed hack alerts on horse/elytra
Raise
speed-threshold
slightly (e.g.
1.2
) to avoid false positives from vanilla movement
Config changes not applying
Run
/evidence reload
or do a full server restart

That’s the complete setup! The plugin is now actively monitoring player connections, block activity, combat, commands, and movement — and sending alerts straight to your Discord. 🎉

insann0491_40243

what we have to do after puting webhook url in there space tell more

Kodari AI
KodariMar 6 at 5:46 am 5,162 (v2)

📋 What Happens After Putting the Webhook URL — Full Breakdown


✅ Step 1 — Put Your Webhook URL in config.yml

YAML
discord-webhook: "https://discord.com/api/webhooks/XXXXXXXXXX/XXXXXXXXXXXXXXXX"

This is the Discord webhook you copy from your Discord channel → Edit Channel → Integrations → Webhooks → Copy Webhook URL


✅ Step 2 — (Optional) Enable Forum Channel Mode

YAML
discord-forum-channel: false
Value
What it does
false
Sends all alerts to a
single channel
(the webhook channel)
true
Sends each alert as a
new thread/post
inside a Forum channel

If your webhook points to a Forum channel, set this to true


✅ Step 3 — Start your server & the plugin activates these monitors:

Module
What it watches
Config key
Block Activity
Mass block breaking (grief detection)
grief-threshold.blocks
/
grief-threshold.seconds
Combat
Kill Aura (too many hits too fast)
anti-hack.kill-aura-hits
/
anti-hack.kill-aura-seconds
Movement
Speed hacking, suspicious location revisits
anti-hack.speed-threshold
/
location-visit-threshold
Commands
Every command a player types
log-commands: true
Connection
Alt accounts (same IP), name changes
Always active

✅ Step 4 — When a suspicious event is triggered, Discord receives an embed like:

Plain Text
🚨 [ALERT] Kill Aura Detected
Player: Steve
Hits in 2 seconds: 10 (threshold: 8)
Location: world, 100, 64, 200
Time: 2025-01-01 12:00:00

All alerts go to the Discord channel linked to your webhook automatically — no extra setup needed.


✅ Step 5 — Staff command for manual evidence lookup

Plain Text
/evidence <player>

This pulls up locally stored logs for that player — block breaks, combat entries, commands, IPs, name history — so you can review before banning.


🔧 Fine-tune your config.yml thresholds:

YAML
grief-threshold:
  blocks: 40       # alerts if player breaks 40+ blocks in 15 seconds
  seconds: 15

anti-hack:
  speed-threshold: 0.65    # movement distance per tick before flagging
  kill-aura-hits: 8        # hits within the time window
  kill-aura-seconds: 2     # time window in seconds

location-visit-threshold: 5   # how many times a player revisits the same spot (xray check)

Increase these values if you’re getting false positives on legit players. Decrease them if hackers are slipping through.


🔕 Turn off modules you don’t want:

YAML
log-commands: false   # stop logging commands
log-blocks: false     # stop grief detection
log-movement: false   # stop speed/location checks

🌟 Summary Flow:

Plain Text
Player does suspicious action
        ↓
SecurityManager detects it
        ↓
LocalStorageManager saves it to disk
        ↓
DiscordWebhookManager sends embed to your Discord
        ↓
Staff sees alert → runs /evidence <player> → decides action

That’s the complete workflow after putting in your webhook URL! Want me to add any extra features like auto-ban thresholds, screenshot requests via Discord buttons, or per-player evidence files?

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
17 1,320
src/main/java/com/secureplayer/evidence/SecurePlayerEvidence.java
package com.secureplayer.evidence;

import com.secureplayer.evidence.commands.EvidenceCommand;
import com.secureplayer.evidence.config.ConfigManager;
import com.secureplayer.evidence.discord.DiscordWebhookManager;
import com.secureplayer.evidence.listeners.BlockActivityListener;
import com.secureplayer.evidence.listeners.CombatListener;
import com.secureplayer.evidence.listeners.CommandListener;
import com.secureplayer.evidence.listeners.MovementListener;
import com.secureplayer.evidence.listeners.PlayerConnectionListener;
import com.secureplayer.evidence.manager.PlayerDataManager;
import com.secureplayer.evidence.manager.SecurityManager;
import com.secureplayer.evidence.storage.LocalStorageManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

public class SecurePlayerEvidence extends JavaPlugin {

    @Getter private static SecurePlayerEvidence instance;
    @Getter private ConfigManager configManager;
    @Getter private DiscordWebhookManager discordWebhookManager;
    @Getter private LocalStorageManager localStorageManager;
    @Getter private PlayerDataManager playerDataManager;
    @Getter private SecurityManager securityManager;

    @Override
    public void onEnable() {
        instance = this;
        saveDefaultConfig();

        this.configManager = new ConfigManager(this);
        this.discordWebhookManager = new DiscordWebhookManager(this);
        this.localStorageManager = new LocalStorageManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.securityManager = new SecurityManager(this);

        getServer().getPluginManager().registerEvents(new PlayerConnectionListener(this), this);
        getServer().getPluginManager().registerEvents(new BlockActivityListener(this), this);
        getServer().getPluginManager().registerEvents(new CombatListener(this), this);
        getServer().getPluginManager().registerEvents(new CommandListener(this), this);
        getServer().getPluginManager().registerEvents(new MovementListener(this), this);

        EvidenceCommand evidenceCommand = new EvidenceCommand(this);
        getCommand("evidence").setExecutor(evidenceCommand);
        getCommand("evidence").setTabCompleter(evidenceCommand);

        getLogger().info("SecurePlayerEvidence enabled.");
    }

    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }
        if (discordWebhookManager != null) {
            discordWebhookManager.shutdown();
        }
        getLogger().info("SecurePlayerEvidence disabled.");
    }
}