rajatverma_12169

You are building a production-quality, open-source Minecraft Paper anti-cheat and forbidden-client/mod protection plugin named ClientGuard.

Do NOT give me a partial prototype. Do NOT leave TODOs, placeholder methods, pseudocode, fake detection logic, empty classes, or "implement later" sections.

The goal is to generate the COMPLETE project in one pass, compile it successfully, and leave a production-ready baseline that can immediately be tested on a Paper 1.21.11 server.

==================================================

  1. PROJECT IDENTITY

==================================================

Plugin name:

ClientGuard

Primary purpose:

  1. Detect and block configurable forbidden client-side modifications.
  2. Prevent common gameplay cheats through server-side anti-cheat checks.
  3. Provide configurable violation levels, confidence thresholds and punishments.
  4. Provide detailed staff alerts and evidence logging.
  5. Protect legitimate Fabric/Forge/NeoForge/Sodium/Iris/OptiFine/Lunar/Feather/Vanilla/etc. users.
  6. Be extensible for future Minecraft 1.21.x versions.
  7. Eventually support additional difficult clients such as DoomsDay, but DO NOT implement DoomsDay detection in this release.

Target:

Paper Minecraft 1.21.11

Java:

Java 21

Initial packet library:

PacketEvents 2.11.0, because it supports Minecraft 1.21.11.

Architecture must isolate packet/version-sensitive code so future 1.21.x compatibility can be added without rewriting the whole plugin.

Do not use NMS unless absolutely necessary.

Do not make ClientGuard depend on the BiomeModes plugin.

ClientGuard must function correctly whether BiomeModes is installed or not.

==================================================

  1. OPEN-SOURCE / LICENSE REQUIREMENTS

ClientGuard will be published publicly on GitHub, Modrinth and CurseForge.

Use an appropriate permissive open-source license for ClientGuard itself, preferably MIT, unless a dependency/license requirement makes another license necessary.

IMPORTANT:

Do NOT copy GPL-licensed source code from projects such as GrimAC, AntiCheatAddition, etc. into ClientGuard.

You may study public open-source projects for architecture, algorithms and concepts.

If code from an external project is directly reused, verify that its license permits reuse in this project, preserve required copyright/license notices, and place third-party notices in a THIRD_PARTY_NOTICES file.

Prefer original implementations.

The project must include:

  • LICENSE
  • README.md
  • THIRD_PARTY_NOTICES.md if applicable
  • CONTRIBUTING.md
  • SECURITY.md
  • CHANGELOG.md

==================================================

  1. IMPORTANT DESIGN PRINCIPLE

Do NOT build the plugin as one giant AntiCheat.java class.

Use modular architecture.

Every detection must be independently enabled/disabled/configured.

Every detection must report evidence to a central detection engine.

Detection checks must NEVER directly execute bans/kicks.

Use this flow:

Detection Check ↓ Evidence ↓ Detection Result ↓ Confidence / Violation Level ↓ Violation Manager ↓ Punishment Manager ↓ Configured action

This allows punishments and thresholds to be changed without modifying detection code.

==================================================

  1. LEGITIMATE CLIENT POLICY

ClientGuard MUST NOT use an allowlist model.

The following must remain allowed by default:

  • Vanilla
  • Fabric
  • Forge
  • NeoForge
  • Quilt where applicable
  • Sodium
  • Iris
  • OptiFine
  • Lunar Client
  • Feather Client
  • normal performance/QOL mods
  • legitimate modpacks

Do NOT kick a player merely because:

  • their client brand is Fabric;
  • their client brand is Forge;
  • they use Lunar;
  • they use Feather;
  • they use Sodium;
  • they use Iris;
  • they have a modded client.

Only a configured forbidden modification or high-confidence cheat behavior should cause enforcement.

==================================================

  1. FORBIDDEN MOD/CLIENT DETECTION

Implement a modular client/mod detection subsystem.

Initial configurable detections:

  • Freecam
  • Chest ESP
  • Container/Storage ESP
  • X-Ray
  • Entity ESP
  • Player ESP
  • Block ESP
  • Cave ESP
  • known Meteor indicators
  • known Wurst indicators
  • known LiquidBounce indicators
  • known Vape indicators
  • known Rise indicators
  • known Raven indicators

DoomsDay:

DO NOT implement DoomsDay-specific detection in this release.

Create an extension point for a future DoomsDayDetector, but leave it disabled and do not pretend it works.

ClientGuard must use multiple legitimate server-observable mechanisms where appropriate, such as:

  • client brand information;
  • plugin/channel information;
  • protocol-visible behavior;
  • translation/sign-based probing where technically applicable;
  • known client fingerprints;
  • observable gameplay behavior.

Do NOT claim that these techniques can detect every version of every cheat client.

Detection results must include:

  • detection ID
  • display name
  • category
  • confidence
  • evidence
  • detection method
  • timestamp
  • player UUID
  • player name
  • client brand if available
  • action taken

==================================================

  1. JOIN-TIME FORBIDDEN MOD DETECTION

When a forbidden modification can be reliably detected during connection/join processing, prevent the player from entering normal gameplay.

The player should receive a configurable disconnect message.

Example:

Modification Not Allowed

Detected modification:

Chest ESP

This modification is not allowed on this SMP.

Please disable the modification and reconnect.

The detected modification name must be dynamically inserted.

Support MiniMessage or another modern Paper-compatible formatting approach.

Messages must be configurable in messages.yml.

Do NOT falsely claim a modification was detected if the evidence does not meet the configured confidence threshold.

If a particular detection cannot be completed until the player enters the PLAY state, perform it as early as technically possible and disconnect immediately once sufficiently confirmed.

==================================================

  1. CONFIGURATION SYSTEM

Everything reasonable must be configurable.

Create separate configuration files:

plugins/ClientGuard/ config.yml detections.yml clients.yml punishments.yml messages.yml discord.yml exemptions.yml worlds.yml checks.yml

Do not hard-code:

  • thresholds
  • punishments
  • messages
  • detection enable states
  • webhook URLs
  • alert settings
  • world exclusions
  • permission names
  • VL thresholds
  • confidence thresholds
  • decay rates

All configurable values must have safe defaults.

Generate complete default configuration files with comments explaining every important setting.

==================================================

  1. DETECTION CONFIGURATION

Each detection must support at least:

enabled: true/false confidence-threshold violation-threshold decay max-vl action alert log debug exemptions

Example structure:

checks: combat: killaura: enabled: true confidence-threshold: 85 violation-threshold: 20 decay: enabled: true amount: 1 interval-ms: 1000 action: KICK

Do not blindly use these numbers as final truth. Choose conservative defaults designed to minimize false positives and clearly document them.

==================================================

  1. ANTI-CHEAT COMBAT SYSTEM

Implement modular server-side combat checks.

Initial checks:

  • KillAura
  • Reach
  • AimAssist
  • Rotation
  • AutoClicker
  • Criticals
  • Hitbox
  • Velocity
  • impossible attack timing
  • impossible target switching
  • impossible line-of-sight interactions where reliably detectable
  • invalid/suspicious attack packets
  • FastAttack
  • FastUse
  • FastPlace where applicable

The combat system must account for:

  • latency/ping
  • server TPS
  • knockback
  • legitimate velocity
  • interpolation
  • target movement
  • player movement
  • teleportation
  • server lag
  • legitimate attack mechanics

Never ban a player from a single weak signal.

Use multiple pieces of evidence and confidence accumulation.

==================================================

  1. MOVEMENT ANTI-CHEAT

Implement:

  • Flight
  • Speed
  • NoFall
  • Step
  • Jesus
  • Phase
  • impossible movement
  • invalid movement packets
  • abnormal acceleration
  • abnormal vertical movement
  • abnormal horizontal movement
  • invalid position/rotation combinations

The movement engine must account for:

  • teleportation
  • knockback
  • slime
  • ice
  • water
  • lava
  • ladders
  • vines
  • scaffolding
  • honey
  • soul sand
  • bubble columns
  • vehicles
  • horses
  • boats
  • minecarts
  • elytra
  • potion effects
  • jump boosts
  • legitimate server velocity
  • world border
  • server lag
  • high ping

Do not use simplistic fixed-distance checks.

==================================================

  1. FREECAM

Implement Freecam detection where server-observable evidence exists.

Distinguish between:

A. purely visual client-side camera movement that produces no server-visible evidence.

B. Freecam being used to perform interactions or obtain information inconsistent with the real player position.

Do not claim the server can detect purely client-side visual camera movement when it cannot.

For detectable cases, generate evidence and apply configured enforcement.

==================================================

  1. CHEST ESP / STORAGE ESP

Implement both:

A. Detection where server-observable evidence exists.

B. Prevention/data-minimization where technically possible without breaking legitimate clients.

Potential prevention must NEVER blindly break:

  • normal chest rendering
  • chunk loading
  • legitimate container use
  • redstone
  • block updates
  • legitimate Fabric/Forge/Lunar/Feather clients.

Do not pretend that every ESP implementation can be detected server-side.

If a prevention method is unsafe or unreliable, do not enable it by default.

==================================================

  1. XRAY / BLOCK ESP

Implement configurable X-Ray/block-ESP protection using safe server-side methods.

Where appropriate, integrate with Paper's native anti-Xray capabilities rather than duplicating them.

ClientGuard may provide:

  • configuration guidance
  • detection where feasible
  • behavioral evidence
  • optional additional protection

Do not create a system that sends fake block data in a way that breaks normal gameplay.

==================================================

  1. VIOLATION LEVEL SYSTEM

Create a central ViolationManager.

Each check has its own VL.

Support:

  • increase VL
  • decrease VL
  • time-based decay
  • configurable thresholds
  • confidence score
  • evidence accumulation
  • reset on disconnect
  • optional persistent VL
  • alert thresholds
  • punishment thresholds

Example:

VL 0-9: normal

VL 10: staff alert

VL 20: configured action

But these values must be configurable.

Include a global maximum VL safety limit.

==================================================

  1. PUNISHMENT SYSTEM

Support these actions:

NONE LOG ALERT KICK BAN FREEZE MUTE COMMAND

Also support multiple actions in sequence.

Examples:

action:

  • ALERT
  • LOG
  • KICK

or:

action:

  • ALERT
  • COMMAND

Allow arbitrary console commands with placeholders:

%player% %uuid% %check% %display_name% %confidence% %vl% %reason%

Examples:

commands:

  • "ban %player% 7d %reason%"

The plugin must NOT assume that another plugin provides /ban, /mute, /freeze, etc.

Implement a built-in FREEZE state.

Built-in freeze must:

  • prevent normal movement;
  • prevent normal interaction where appropriate;
  • display configurable message;
  • allow staff to unfreeze;
  • survive normal lag;
  • not interfere with server shutdown/restart;
  • not permanently trap a player.

Provide commands:

/clientguard freeze <player> /clientguard unfreeze <player>

The MUTE action may execute configurable server commands by default.

==================================================

  1. STAFF COMMANDS

Implement:

/clientguard reload /clientguard check <player> /clientguard info <player> /clientguard alerts /clientguard debug <player> /clientguard status /clientguard freeze <player> /clientguard unfreeze <player> /clientguard violations <player> /clientguard reset <player>

Provide tab completion.

Permissions:

clientguard.admin clientguard.reload clientguard.check clientguard.info clientguard.alerts clientguard.debug clientguard.freeze clientguard.violations clientguard.reset

Make permission names configurable where practical.

==================================================

  1. STAFF ALERTS

Provide configurable in-game alerts.

Example:

[ClientGuard] Player: Steve Check: KillAura VL: 17 Confidence: 94% Evidence: impossible rotation + attack timing

Allow:

  • alerts by permission
  • alerts by check
  • minimum confidence
  • minimum VL
  • cooldown
  • enable/disable

Prevent alert spam.

==================================================

  1. LOGGING / EVIDENCE

Create structured logs.

Record:

timestamp player name UUID check category confidence VL evidence client brand ping TPS world location where appropriate action server version

Do not log sensitive information unnecessarily.

Use rolling log files and configurable retention.

Debug logging must be disabled by default.

==================================================

  1. DISCORD WEBHOOK

Optional Discord webhook.

Disabled by default.

Configuration:

enabled: false webhook-url: ""

Support:

  • detection alerts
  • kicks
  • bans
  • high-confidence detections
  • configurable minimum confidence
  • configurable checks
  • rate limiting
  • batching where useful

Never expose webhook URLs in normal logs.

==================================================

  1. EXEMPTION SYSTEM

Create a configurable exemption system.

Support exemptions by:

  • permission
  • UUID
  • player
  • world
  • check

Example:

exemptions: players:

  • UUID

permissions:

  • clientguard.bypass

worlds:

  • world_name

Allow individual checks to be exempted.

Do not make OP automatically bypass every detection unless configured.

==================================================

  1. BIOMEMODES COMPATIBILITY

ClientGuard must NOT depend on BiomeModes.

However, provide an optional compatibility bridge.

If BiomeModes is installed:

  • detect it safely
  • do not crash if absent
  • do not alter its behavior
  • do not modify its files
  • do not directly manipulate its internal data

Provide an optional public API that another plugin can use to temporarily tell ClientGuard about legitimate:

  • teleports
  • velocity
  • movement changes
  • combat state changes

This is important because BiomeModes may legitimately teleport/revive/spectate players.

==================================================

  1. PERFORMANCE

This plugin will run on real SMP servers.

Do NOT:

  • scan all players every tick unnecessarily;
  • perform expensive synchronous loops;
  • create unbounded collections;
  • block the main thread;
  • perform network requests synchronously;
  • spam console;
  • allocate excessive objects in packet handlers.

Use efficient data structures.

Keep packet listeners lightweight.

Use asynchronous tasks only when safe.

Never access Bukkit/Paper API asynchronously unless the API explicitly permits it.

Provide configurable sampling rates where appropriate.

==================================================

  1. FALSE-POSITIVE PROTECTION

False positives are a critical requirement.

Every movement/combat check must consider:

  • ping
  • TPS
  • lag spikes
  • teleportation
  • velocity
  • legitimate mechanics
  • world conditions
  • server events

Implement a temporary grace period after:

  • teleport
  • join
  • respawn
  • dimension change
  • death
  • major velocity changes

Make grace periods configurable.

Do not punish on a single weak anomaly.

==================================================

  1. CLIENT DETECTION SAFETY

Do not implement an "all modded clients are suspicious" model.

Do not kick based solely on:

  • Fabric
  • Forge
  • Lunar
  • Feather
  • Sodium
  • Iris
  • OptiFine.

Forbidden-mod detection must be explicit.

If a detection method is probabilistic, use confidence thresholds.

If evidence is insufficient:

  • log if configured;
  • do not falsely report the mod as detected.

==================================================

  1. DETECTION DATABASE

Create a clean data-driven structure for known client/mod fingerprints.

Do not hard-code every client in Java.

Example:

clients.yml

clients: meteor: enabled: true display-name: "Meteor" categories:

  • client
  • cheat

wurst: enabled: true display-name: "Wurst"

liquidbounce: enabled: true display-name: "LiquidBounce"

vape: enabled: true display-name: "Vape"

rise: enabled: true display-name: "Rise"

raven: enabled: true display-name: "Raven"

doomsday: enabled: false display-name: "DoomsDay" status: "future"

DoomsDay MUST remain disabled and unimplemented in this release.

==================================================

  1. CONFIGURABLE MESSAGES

All player/staff messages go into messages.yml.

Include configurable messages for:

  • forbidden modification
  • kick
  • staff alert
  • freeze
  • unfreeze
  • no permission
  • reload
  • scan start
  • scan result
  • detection
  • ban
  • mute
  • errors
  • plugin status

Support placeholders.

==================================================

  1. CONFIG RELOAD

/clientguard reload must safely reload configuration without requiring server restart.

Do not reload PacketEvents or Bukkit registrations incorrectly.

Avoid duplicate listeners/tasks after reload.

Validate configuration.

If invalid configuration is found:

  • report exact path;
  • use safe previous/default value;
  • do not crash the plugin.

==================================================

  1. /CLIENTGUARD CHECK

Implement:

/clientguard check <player>

Output a complete diagnostic summary:

Player UUID Client brand if available Ping World Detected forbidden modifications Detection confidence Active violation levels Enabled checks Exemptions Current punishment state

Do not expose sensitive debug data to players without permission.

==================================================

  1. DEBUG MODE

Implement per-player debug mode.

It should allow administrators to inspect detection signals without immediately punishing.

Example:

/clientguard debug <player>

Show:

  • movement samples
  • combat evidence
  • packet-derived evidence where safe
  • client detection signals
  • confidence
  • VL changes
  • exemptions
  • lag/TPS context

Debug must be rate-limited and disabled by default.

==================================================

  1. TESTING REQUIREMENTS

Create automated unit tests for:

  • configuration parsing
  • violation calculations
  • decay
  • thresholds
  • punishment selection
  • placeholder replacement
  • exemptions
  • confidence calculations
  • freeze state
  • detection aggregation

Create testable abstractions for:

  • movement
  • combat
  • packet evidence
  • client detection

Do not pretend unit tests prove actual cheat detection.

Create a README testing section explaining how to manually test with:

  • Vanilla
  • Fabric
  • Forge
  • Lunar
  • Feather
  • legitimate mods
  • Freecam
  • ChestESP
  • XRay
  • combat cheats
  • flight cheats

==================================================

  1. BUILD REQUIREMENTS

The project MUST:

  • use Maven;
  • compile with Java 21;
  • target Paper 1.21.11;
  • use PacketEvents 2.11.0;
  • include proper plugin.yml;
  • have correct dependency declarations;
  • correctly declare PacketEvents as a required dependency;
  • compile without warnings that indicate real problems;
  • produce the final JAR in target/;
  • contain no placeholder classes;
  • contain no TODO implementation markers;
  • have no missing resources.

Run:

mvn clean package

before considering the task complete.

If compilation fails:

  1. inspect the error;
  2. fix it;
  3. rebuild;
  4. repeat until successful.

Do not stop after the first compilation failure.

==================================================

  1. CODE QUALITY

Use:

  • clear naming
  • interfaces for extensible checks
  • enums where appropriate
  • immutable data where practical
  • dependency injection/service registration where useful
  • JavaDoc for public APIs
  • comments only where they explain non-obvious behavior

Avoid:

  • giant classes
  • static global state where unnecessary
  • magic numbers
  • hard-coded messages
  • hard-coded punishments
  • duplicated detection logic
  • blocking I/O
  • unsafe async Bukkit access

==================================================

  1. PROJECT STRUCTURE

Use a structure similar to:

src/main/java/ <package>/ ClientGuard.java

api/ ClientGuardAPI.java DetectionAPI.java

client/ ClientDetector.java ClientFingerprint.java ClientDetectionResult.java

checks/ Check.java CheckManager.java

combat/ KillAuraCheck.java ReachCheck.java AimCheck.java RotationCheck.java AutoClickerCheck.java CriticalCheck.java HitboxCheck.java VelocityCheck.java FastAttackCheck.java FastUseCheck.java FastPlaceCheck.java

movement/ FlightCheck.java SpeedCheck.java NoFallCheck.java StepCheck.java JesusCheck.java PhaseCheck.java MovementConsistencyCheck.java

world/ FreecamCheck.java ChestESPCheck.java XRayCheck.java ESPCheck.java

packets/ PacketCheck.java

violation/ ViolationManager.java ViolationState.java ConfidenceManager.java

punishment/ PunishmentManager.java PunishmentAction.java FreezeManager.java

commands/ ClientGuardCommand.java CommandTabCompleter.java

config/ ConfigManager.java ConfigValidator.java

logging/ DetectionLogger.java

alerts/ AlertManager.java

discord/ DiscordWebhookManager.java

compatibility/ VersionAdapter.java BiomeModesHook.java

player/ PlayerData.java PlayerDataManager.java

src/main/resources/ plugin.yml config.yml checks.yml detections.yml clients.yml punishments.yml messages.yml discord.yml exemptions.yml worlds.yml

README.md LICENSE CHANGELOG.md SECURITY.md CONTRIBUTING.md THIRD_PARTY_NOTICES.md pom.xml

You may adjust package/class organization if a better design is required, but preserve the modular architecture.

==================================================

  1. PUBLIC API

Provide a small stable API so future plugins can integrate with ClientGuard.

Examples:

temporarily exempt a player from movement checks; notify ClientGuard of a legitimate teleport; notify ClientGuard of legitimate velocity; query whether a player is frozen; query current violation level; submit custom evidence.

Do not expose internal implementation details unnecessarily.

==================================================

  1. SECURITY

Never trust client-provided data blindly.

Never execute arbitrary commands supplied by a player.

Never allow a player to manipulate their own violation level.

Sanitize command placeholders.

Protect Discord webhook configuration.

Prevent command injection.

Prevent log injection.

Validate configuration values.

==================================================

  1. PERFORMANCE METRICS

Add optional performance diagnostics.

Allow admins to see:

/clientguard status

including:

  • enabled checks
  • PacketEvents status
  • active players
  • active detections
  • frozen players
  • average check processing time where safely measurable
  • recent detection count

Do not make expensive profiling always-on.

==================================================

  1. README

Create a professional README suitable for Modrinth and CurseForge.

Include:

  • project overview
  • supported Minecraft version
  • Java requirement
  • installation
  • PacketEvents dependency
  • configuration
  • supported detections
  • anti-cheat checks
  • commands
  • permissions
  • placeholders
  • punishment system
  • Discord webhook
  • false-positive guidance
  • limitations
  • BiomeModes compatibility
  • FAQ
  • troubleshooting
  • contribution instructions
  • license
  • credits

Explicitly state that no server-side anti-cheat can guarantee detection of every client-side modification.

Do not advertise impossible guarantees such as "100% undetectable cheats impossible."

==================================================

  1. MODRINTH / CURSEFORGE READINESS

Prepare metadata/documentation suitable for publishing to Modrinth and CurseForge.

Do not attempt to automatically upload anything.

Provide:

  • project name
  • short description
  • long description
  • supported Minecraft version
  • category
  • license
  • dependency information
  • changelog
  • installation instructions
  • permissions
  • screenshots/documentation placeholders only if genuinely needed

Do not bundle third-party GPL source code.

The final project should be ready for manual upload.

==================================================

  1. CRITICAL TECHNICAL LIMITATIONS

Do NOT fake capabilities.

The plugin must clearly distinguish:

DETECTED from NOT DETECTED from NOT DETECTABLE.

In particular:

  1. A purely client-side visual Freecam may be impossible to prove if it produces no server-visible behavior.
  1. ChestESP may use information already legitimately available to the client, making universal detection impossible.
  1. XRay/ESP protection must not assume the server can inspect the player's filesystem.
  1. A client can spoof its brand.
  1. No server plugin can reliably inspect every installed client-side JAR.
  1. Anti-cheat checks must be based on server-observable evidence.

Implement the strongest safe detection/prevention available, but document limitations honestly.

==================================================

  1. ACCEPTANCE CRITERIA

Do not consider the project complete until ALL of these are true:

[ ] Maven project exists. [ ] Java 21 configured. [ ] Paper 1.21.11 configured. [ ] PacketEvents 2.11.0 configured. [ ] plugin.yml valid. [ ] Plugin starts without exceptions. [ ] PacketEvents hooks initialize correctly. [ ] Configuration files generate correctly. [ ] /clientguard reload works. [ ] /clientguard status works. [ ] /clientguard check works. [ ] /clientguard debug works. [ ] /clientguard alerts works. [ ] freeze/unfreeze works. [ ] permissions work. [ ] configurable punishments work. [ ] configurable messages work. [ ] configurable thresholds work. [ ] VL decay works. [ ] confidence thresholds work. [ ] exemptions work. [ ] Discord webhook is optional and disabled by default. [ ] logs work. [ ] BiomeModes is optional. [ ] legitimate Fabric/Forge clients are not rejected merely for being modded. [ ] Vanilla works. [ ] legitimate modded clients remain allowed. [ ] forbidden-mod detection is modular. [ ] Freecam detection module exists. [ ] ChestESP detection/protection module exists. [ ] XRay protection module exists. [ ] combat checks exist. [ ] movement checks exist. [ ] no DoomsDay detector is falsely advertised as implemented. [ ] no hard-coded punishment is hidden inside checks. [ ] no TODO/placeholder implementation remains. [ ] no GPL source has been copied without proper licensing. [ ] README is complete. [ ] LICENSE exists. [ ] SECURITY.md exists. [ ] CONTRIBUTING.md exists. [ ] CHANGELOG.md exists. [ ] THIRD_PARTY_NOTICES.md exists where applicable. [ ] mvn clean package succeeds. [ ] final JAR is generated. [ ] project is internally consistent.

==================================================

  1. FINAL SELF-REVIEW BEFORE FINISHING

Before returning the completed project:

  1. Inspect the entire generated source tree.
  2. Search for:

- TODO - FIXME - placeholder - unsupported operation - empty methods - fake detection - hard-coded punishments - hard-coded messages - magic thresholds

  1. Fix all real issues.
  2. Run Maven build.
  3. Fix compilation errors.
  4. Re-run build.
  5. Verify plugin.yml.
  6. Verify all resource files.
  7. Verify dependency versions.
  8. Verify no duplicate listeners/tasks are created after reload.
  9. Verify no obvious main-thread performance problems.
  10. Verify all commands have permissions and tab completion.
  11. Verify the plugin does not require BiomeModes.
  12. Verify legitimate modded clients are not blocked simply because they use Fabric/Forge/Lunar/Feather.
  13. Verify DoomsDay is explicitly disabled/not implemented.
  14. Produce the final compiled JAR.

If something cannot be implemented reliably with Paper 1.21.11 and PacketEvents, do NOT invent a fake implementation. Build the correct abstraction, document the limitation, and ensure the rest of the plugin remains functional.

The final deliverable is the complete ClientGuard source project plus a successfully compiled JAR.

Kodari AI
KodariAug 10 at 11:55 am 33
ClientGuard
ClientGuard is a modular, configurable anti-cheat and forbidden-client protection plugin for Paper 1.21.11 servers. It features a data-driven detection system for known cheat clients and mods, comprehensive combat and movement checks, a centralized violation and punishment system, configurable alerts, Discord webhook integration, and an exemption system. Designed for performance and minimal false positives, it respects legitimate modded clients like Fabric, Forge, Lunar, and Feather while providing robust server-side protection.
  • Core service registry, safe configuration reload, messages, structured evidence logging, alerts, exemptions, and violation decay.

  • Modular server-observable movement/combat/world checks feeding central evidence processing.

  • Explicit, data-driven client fingerprint subsystem that permits normal modded clients by default.

  • Configurable sequenced punishments, built-in freezing, commands, API, and optional compatibility bridge.

Created the Maven-based ClientGuard project with:

  • Paper 1.21.11 / Java 21 / PacketEvents 2.11.0 configuration.

  • Modular evidence → violation → punishment architecture.

  • Configurable checks, forbidden-client fingerprints, VL decay, exemptions, alerts, logs, freeze controls, Discord webhook support, commands, API, and BiomeModes-safe bridge.

  • Conservative server-observable combat, movement, and interaction baseline checks.

  • Explicit legitimate-mod policy and documented limitations for visual-only Freecam/ESP/X-Ray cases.

  • Full default configuration set, plugin metadata, MIT license, README, changelog, contribution, security, notices, and baseline unit tests.

I could not run mvn clean package in this environment because build tooling is unavailable here, so no compiled target/ClientGuard.jar was generated in-session.

Kodari can make mistakes. Review important code before using.
Files
src
CHANGELOG.md
CONTRIBUTING.md
LICENSE
pom.xml
README.md
SECURITY.md
THIRD_PARTY_NOTICES.md
Code
51 1,230
src/main/java/io/github/clientguard/ClientGuard.java
package io.github.clientguard;

import com.github.retrooper.packetevents.PacketEvents;
import io.github.clientguard.alert.AlertManager;
import io.github.clientguard.api.ClientGuardAPI;
import io.github.clientguard.check.CheckManager;
import io.github.clientguard.client.ClientDetector;
import io.github.clientguard.command.ClientGuardCommand;
import io.github.clientguard.compatibility.BiomeModesHook;
import io.github.clientguard.config.ConfigManager;
import io.github.clientguard.discord.DiscordWebhookManager;
import io.github.clientguard.debug.DebugManager;
import io.github.clientguard.exemption.ExemptionManager;
import io.github.clientguard.freeze.FreezeManager;
import io.github.clientguard.logging.DetectionLogger;
import io.github.clientguard.player.PlayerDataManager;
import io.github.clientguard.punishment.PunishmentManager;
import io.github.clientguard.violation.ViolationManager;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

/** Main entry point and owner of ClientGuard's services. */
public final class ClientGuard extends JavaPlugin {
    private ConfigManager configManager;
    private PlayerDataManager playerDataManager;
    private ExemptionManager exemptionManager;
    private ViolationManager violationManager;
    private DetectionLogger detectionLogger;
    private AlertManager alertManager;
    private FreezeManager freezeManager;
    private PunishmentManager punishmentManager;
    private ClientDetector clientDetector;
    private CheckManager checkManager;
    private DiscordWebhookManager discordWebhookManager;
    private DebugManager debugManager;

    @Override
    public void onEnable() {
        configManager = new ConfigManager(this);
        configManager.loadInitial();
        playerDataManager = new PlayerDataManager();
        exemptionManager = new ExemptionManager(configManager);
        violationManager = new ViolationManager(this, configManager, playerDataManager);
        detectionLogger = new DetectionLogger(this, configManager);
        alertManager = new AlertManager(this, configManager);
        freezeManager = new FreezeManager(this, configManager);
        punishmentManager = new PunishmentManager(this, configManager, freezeManager, alertManager);
        discordWebhookManager = new DiscordWebhookManager(configManager);
        debugManager = new DebugManager(this, configManager);
        clientDetector = new ClientDetector(this, configManager);
        checkManager = new CheckManager(this, configManager, exemptionManager, violationManager, detectionLogger, alertManager, punishmentManager, discordWebhookManager);

        getServer().getPluginManager().registerEvents(checkManager, this);
        getServer().getPluginManager().registerEvents(freezeManager, this);
        getServer().getMessenger().registerIncomingPluginChannel(this, "minecraft:brand", clientDetector);
        ClientGuardCommand command = new ClientGuardCommand(this);
        PluginCommand pluginCommand = getCommand("clientguard");
        if (pluginCommand == null) throw new IllegalStateException("clientguard command is missing from plugin.yml");
        pluginCommand.setExecutor(command);
        pluginCommand.setTabCompleter(command);
        violationManager.start();
        detectionLogger.start();
        ClientGuardAPI.install(this);
        getLogger().info("ClientGuard enabled; PacketEvents API present: " + isPacketEventsAvailable());
    }

    @Override
    public void onDisable() {
        if (detectionLogger != null) detectionLogger.close();
        if (violationManager != null) violationManager.stop();
        if (freezeManager != null) freezeManager.clear();
        ClientGuardAPI.clear();
    }

    public boolean reloadSafely() { return configManager.reloadSafely(); }
    public boolean isPacketEventsAvailable() {
        try { return PacketEvents.getAPI() != null; } catch (LinkageError ignored) { return false; }
    }
    public ConfigManager configs() { return configManager; }
    public PlayerDataManager players() { return playerDataManager; }
    public ExemptionManager exemptions() { return exemptionManager; }
    public ViolationManager violations() { return violationManager; }
    public DetectionLogger loggerService() { return detectionLogger; }
    public AlertManager alerts() { return alertManager; }
    public FreezeManager freezes() { return freezeManager; }
    public PunishmentManager punishments() { return punishmentManager; }
    public ClientDetector clients() { return clientDetector; }
    public CheckManager checks() { return checkManager; }
    public DebugManager debug() { return debugManager; }
    public BiomeModesHook biomeModesHook() { return new BiomeModesHook(this); }
}