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.
==================================================
- PROJECT IDENTITY
==================================================
Plugin name:
ClientGuard
Primary purpose:
- Detect and block configurable forbidden client-side modifications.
- Prevent common gameplay cheats through server-side anti-cheat checks.
- Provide configurable violation levels, confidence thresholds and punishments.
- Provide detailed staff alerts and evidence logging.
- Protect legitimate Fabric/Forge/NeoForge/Sodium/Iris/OptiFine/Lunar/Feather/Vanilla/etc. users.
- Be extensible for future Minecraft 1.21.x versions.
- 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.
==================================================
- 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
==================================================
- 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.
==================================================
- 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.
==================================================
- 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
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- PUNISHMENT SYSTEM
Support these actions:
NONE LOG ALERT KICK BAN FREEZE MUTE COMMAND
Also support multiple actions in sequence.
Examples:
action:
or:
action:
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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- EXEMPTION SYSTEM
Create a configurable exemption system.
Support exemptions by:
- permission
- UUID
- player
- world
- check
Example:
exemptions: players:
permissions:
worlds:
Allow individual checks to be exempted.
Do not make OP automatically bypass every detection unless configured.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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:
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.
==================================================
- 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.
==================================================
- 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.
==================================================
- /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.
==================================================
- 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.
==================================================
- 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
==================================================
- 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:
- inspect the error;
- fix it;
- rebuild;
- repeat until successful.
Do not stop after the first compilation failure.
==================================================
- 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
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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.
==================================================
- 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."
==================================================
- 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.
==================================================
- CRITICAL TECHNICAL LIMITATIONS
Do NOT fake capabilities.
The plugin must clearly distinguish:
DETECTED from NOT DETECTED from NOT DETECTABLE.
In particular:
- A purely client-side visual Freecam may be impossible to prove if it produces no server-visible behavior.
- ChestESP may use information already legitimately available to the client, making universal detection impossible.
- XRay/ESP protection must not assume the server can inspect the player's filesystem.
- A client can spoof its brand.
- No server plugin can reliably inspect every installed client-side JAR.
- Anti-cheat checks must be based on server-observable evidence.
Implement the strongest safe detection/prevention available, but document limitations honestly.
==================================================
- 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.
==================================================
- FINAL SELF-REVIEW BEFORE FINISHING
Before returning the completed project:
- Inspect the entire generated source tree.
- Search for:
- TODO - FIXME - placeholder - unsupported operation - empty methods - fake detection - hard-coded punishments - hard-coded messages - magic thresholds
- Fix all real issues.
- Run Maven build.
- Fix compilation errors.
- Re-run build.
- Verify plugin.yml.
- Verify all resource files.
- Verify dependency versions.
- Verify no duplicate listeners/tasks are created after reload.
- Verify no obvious main-thread performance problems.
- Verify all commands have permissions and tab completion.
- Verify the plugin does not require BiomeModes.
- Verify legitimate modded clients are not blocked simply because they use Fabric/Forge/Lunar/Feather.
- Verify DoomsDay is explicitly disabled/not implemented.
- 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.