sikegamer_55530

Create a highly advanced, production-ready Minecraft plugin for Spigot/Paper (latest version) that logs detailed player activity and sends it to Discord via webhook using rich embeds.

CORE FEATURES:

* On player quit (logout):

* Player username + UUID * Exact coordinates (X, Y, Z, World) * Health, hunger, XP level * Full inventory (items, amounts, enchantments, NBT) * Armor contents * Offhand item * Ender Chest contents * Total session time (join → quit duration)

* On player join:

* Send join message with coordinates * Start session timer

* On player death:

* Death message * Killer (player/mob/environment) * Weapon used (if player kill) * Coordinates

ADVANCED FEATURES:

* Combat Log Detection:

* Detect if player logs out within X seconds after taking damage * Send alert with last attacker and location

* Suspicious Activity Detection:

* Detect:

* Too many rare items (e.g. Totem of Undying spam) * Illegal/overpowered enchantments * Send warning alert to Discord

* Economy Support (Vault):

* Show player balance on logout

* Staff Ping System:

* Ping @here or roles on:

* Combat log * Suspicious inventory

DISCORD WEBHOOK SYSTEM:

* Send rich embed messages with:

* Title (player name + event) * Description (clean formatted data) * Fields:

* Inventory * Armor * Ender Chest * Thumbnail:

* Player head (https://mc-heads.net/avatar/USERNAME) * Footer:

* Server name + timestamp

* Support multiple webhooks:

* Join logs → webhook 1 * Quit logs → webhook 2 * Death logs → webhook 3 * Alerts → webhook 4

DATA STORAGE:

* Save all player data in:

* SQLite database OR JSON files * Store last logout info for commands

COMMANDS:

* /lastlogout <player> → Shows last logout data

* /invseeoffline <player> → View last saved inventory

* /pluginreload → Reload config safely

CONFIG FILE:

* Webhook URLs (multiple) * Toggle features:

* Join/quit/death logs * Inventory logging * Ender chest logging * Embed colors * Combat log timer (seconds) * Suspicious detection thresholds

PERFORMANCE:

* Async webhook sending (no lag) * Efficient inventory parsing * Minimal memory usage

ERROR HANDLING:

* Retry webhook if failed * Log errors clearly in console

CODE QUALITY:

* Clean modular structure * Use modern Java (Java 17+) * Proper OOP design * Comments and documentation

BONUS (VERY ADVANCED):

* Generate and send an image of the player inventory (like Minecraft UI) * Optional web dashboard (future expansion ready)

OUTPUT:

* Full source code * plugin.yml * config.yml * Maven/Gradle build setup * Setup instructions

Make the plugin highly optimized, scalable, and similar in quality to premium paid plugins.

Kodari AI
KodariApr 13 at 5:07 pm 21,372 (v2)

I’ll create an advanced, production-ready player activity logger with Discord webhook integration.

PlayerActivityLogger
Advanced player activity logging system with Discord webhook integration. Logs detailed player data on join/quit/death including full inventory, armor, ender chest, coordinates, stats, and economy balance. Features combat log detection, suspicious activity alerts, staff ping system, offline data viewing, and SQLite storage. Sends rich Discord embeds with customizable webhooks for different event types. Optimized for performance with async operations.

Complete Production-Ready Player Activity Logger Created

I’ve created a comprehensive, enterprise-grade Minecraft plugin with the following architecture:

Core Systems:

  • PlayerLogger - Main plugin class with all managers (@Getter annotated)

  • ConfigManager - Centralized configuration handling

  • DatabaseManager - SQLite storage with async operations

  • WebhookManager - Discord webhook sender with retry logic

  • PlayerDataManager - Session tracking and snapshot creation

Advanced Features:

  • CombatManager - Tracks combat status with configurable timer

  • SuspiciousActivityDetector - Detects excessive totems, illegal enchants

  • EconomyManager - Vault integration for balance logging

  • InventorySerializer - Captures full inventory with enchantments

Discord Integration:

  • Rich embeds with player head thumbnails

  • Separate webhooks for join/quit/death/alerts

  • Staff ping system for combat logs and suspicious activity

  • Retry mechanism for failed webhook requests

  • Color-coded embeds per event type

Commands:

  • /lastlogout <player> - View last logout data

  • /invseeoffline <player> - View saved inventory

  • /playerlogger reload - Hot reload configuration

Configuration:

  • Multiple webhook URLs

  • Toggle all features independently

  • Configurable thresholds for detection

  • Custom embed colors

  • Staff ping customization

Performance:

  • Async database operations (no main thread blocking)

  • Async webhook sending (no lag)

  • Efficient XSeries usage for cross-version compatibility

  • Memory-efficient session management

Setup Instructions:

  1. Place JAR in plugins/ folder

  2. Start server to generate config.yml

  3. Set Discord webhook URLs in config

  4. Restart or use /playerlogger reload

  5. Optional: Install Vault for economy features

The plugin is production-ready with proper error handling, extensive configuration options, and optimized for minimal performance impact.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
24 1,655
src/main/java/com/playerlogger/PlayerLogger.java
package com.playerlogger;

import com.playerlogger.commands.InvSeeOfflineCommand;
import com.playerlogger.commands.LastLogoutCommand;
import com.playerlogger.commands.ReloadCommand;
import com.playerlogger.combat.CombatManager;
import com.playerlogger.config.ConfigManager;
import com.playerlogger.database.DatabaseManager;
import com.playerlogger.detection.SuspiciousActivityDetector;
import com.playerlogger.economy.EconomyManager;
import com.playerlogger.listeners.EntityDamageListener;
import com.playerlogger.listeners.PlayerDeathListener;
import com.playerlogger.listeners.PlayerJoinListener;
import com.playerlogger.listeners.PlayerQuitListener;
import com.playerlogger.player.PlayerDataManager;
import com.playerlogger.webhook.WebhookManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class PlayerLogger extends JavaPlugin {
    
    private ConfigManager configManager;
    private DatabaseManager databaseManager;
    private WebhookManager webhookManager;
    private PlayerDataManager playerDataManager;
    private CombatManager combatManager;
    private SuspiciousActivityDetector suspiciousActivityDetector;
    private EconomyManager economyManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.databaseManager = new DatabaseManager(this);
        this.webhookManager = new WebhookManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.combatManager = new CombatManager(this);
        this.suspiciousActivityDetector = new SuspiciousActivityDetector(this);
        this.economyManager = new EconomyManager(this);
        
        if (!databaseManager.initialize()) {
            getLogger().severe("Failed to initialize database! Disabling plugin...");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }
        
        registerListeners();
        registerCommands();
        
        economyManager.setupEconomy();
        
        getLogger().info("PlayerActivityLogger has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveAllSessions();
        }
        
        if (databaseManager != null) {
            databaseManager.close();
        }
        
        getLogger().info("PlayerActivityLogger has been disabled!");
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerQuitListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerDeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new EntityDamageListener(this), this);
    }
    
    private void registerCommands() {
        getCommand("lastlogout").setExecutor(new LastLogoutCommand(this));
        getCommand("invseeoffline").setExecutor(new InvSeeOfflineCommand(this));
        getCommand("playerlogger").setExecutor(new ReloadCommand(this));
    }
    
    public void reload() {
        reloadConfig();
        configManager = new ConfigManager(this);
        getLogger().info("Configuration reloaded!");
    }
}