rkboss95yt
📎 1 file 13,850 chars
📄
pasted-code-1787392650702.txt
txt 900 lines
▶
# Boss Anti Cheat — Complete Minecraft Anti-Cheat Plugin

Create a production-quality Minecraft server anti-cheat plugin named **Boss Anti Cheat (BAC)**.

The plugin should be a serious, highly configurable anti-cheat similar in scope to Vulcan/Grim, with advanced Combat, Movement, Player, Packet, Latency, Punishment, Logging and Staff-management systems.

---

# 1. CORE REQUIREMENTS

Support:

- Paper
- Purpur
- Modern Minecraft versions
- Version-compatible packet/NMS abstraction

The plugin must be:

- Lightweight
- Highly optimized
- Modular
- Fully configurable
- Resistant to false positives
- Suitable for 50–200+ players
- Event-driven where possible
- Packet-aware where necessary

Every check must support:

- Enabled/disabled
- Buffer
- Violation Level
- VL decay
- Detection sensitivity
- Confidence
- Punishment threshold
- Alerts
- Logging
- Debug
- Permission bypass
- Custom punishment commands

Do not hard-code important values.

---

# 2. COMBAT CHECKS

Implement:

- Aim
- Auto Block
- Auto Clicker
- TriggerBot
- Criticals
- Fast Bow
- Hitbox
- KillAura
- Reach
- Velocity
- AutoStun
- AutoSwap
- NoSwing
- FastInteract
- Rotation
- BadRotation
- HitDelay
- FastConsume
- FastHeal

## TriggerBot — REALTIME

Create a dedicated realtime TriggerBot detector.

Detect:

- Automatic attack when target enters crosshair
- Extremely consistent attack reaction time
- Near-zero reaction times
- Repeated identical reaction intervals
- Suspicious target alignment
- Machine-like attack timing
- Repeated attacks synchronized with target movement

Use rolling samples and statistical analysis.

Never punish based on one attack.

---

# 3. KILLAURA

Use multiple detection layers:

- Rotation analysis
- Target switching
- Attack timing
- Target alignment
- Attack angles
- Multi-target behavior
- Impossible rotations
- Suspicious target selection
- Historical target positions

Do not rely on one signal.

---

# 4. LATENCY-AWARE REACH

Create a dedicated `LatencyManager`.

Track:

- Current ping
- Smoothed ping
- Ping variance
- Packet delay
- Recent latency history
- Server TPS
- Position history

For Reach and KillAura:

- Reconstruct historical positions
- Account for packet delay
- Account for client/server positional difference
- Calculate latency-compensated attack distance
- Dynamically adjust tolerance
- Reduce confidence during unstable ping

Example configurable system:

```yaml
latency:
  enabled: true

  reach-compensation:
    enabled: true

    "0-100":
      extra-reach: 0.0

    "100-200":
      extra-reach: 0.25

    "200-300":
      extra-reach: 1.0

    "300+":
      extra-reach: 1.25

  high-ping-combat:
    suppress-reach: true
    suppress-killaura: true
    minimum-confidence: 0.90
```

These are default examples only and must be completely configurable.

IMPORTANT:

Do NOT simply do:

`if ping > 200 then ignore player`

Instead, use actual latency compensation.

A 200–300ms player should not be punished simply because their server-side position makes their reach appear larger.

However, clearly impossible combat behavior should still be detectable even at high ping.

---

# 5. MOVEMENT CHECKS

Implement all of these:

- Anti Levitation
- Boat Fly
- Entity Speed
- Entity Flight
- Elytra
- Fast Climb
- Flight
- Jesus
- Jump
- Motion
- No Saddle
- No Slow
- Speed
- Step
- Sprint
- Strafe
- Scaffold
- VClip
- Wall Climb

Flight must detect:

- Air walking
- Floating
- Hovering
- Impossible acceleration
- Invalid vertical movement
- Invalid horizontal movement
- Ground spoofing

Use server-side movement simulation.

Do not false flag normal lag spikes.

---

# 6. PLAYER / PACKET CHECKS

Implement:

- Air Place
- Bad Packets
- Baritone
- Fast Break
- Fast Place
- Fast Use
- Ground Spoof
- Ghost Hand
- Improbable
- Invalid
- Inventory
- Timer
- Tower

Bad Packets should detect:

- Invalid movement packets
- Invalid rotations
- Invalid interactions
- Packet spam
- Impossible packet sequences
- Invalid packet ordering

---

# 7. ADVANCED CHECKS

### AutoStun

Detect automated stun behavior using:

- Action timing
- Rotation
- Target state
- Packet sequence
- Interaction sequence
- Repetition patterns

Do not flag legitimate stun mechanics.

### AutoSwap

Detect impossible combat inventory/slot switching.

### NoSwing

Detect suspicious attacks/interactions without required swing behavior where applicable.

### FastInteract

Detect impossible interaction frequency.

### InventoryMove

Detect movement where inventory/container restrictions should prevent it.

### PacketOrder

Detect impossible packet ordering.

### BadRotation

Detect invalid yaw/pitch and impossible rotation packets.

### HitDelay

Detect attacks bypassing normal attack timing.

### FastConsume

Detect impossible eating/drinking.

### FastHeal

Detect impossible healing-item usage.

---

# 8. FALSE POSITIVE PROTECTION

Create a central `FalsePositiveManager`.

Temporarily reduce or suspend sensitive checks during:

- Teleport
- Respawn
- Join
- World change
- Vehicle enter/exit
- Elytra start/stop
- Knockback
- Explosion
- Slime
- Water
- Piston movement
- Server correction
- Large ping spikes
- Low TPS
- Severe packet delay

Never punish simply because:

- Player has high ping
- TPS is low
- Player teleported
- Player received knockback
- Player entered a vehicle
- Player is using legitimate Elytra
- Player experienced packet delay

---

# 9. VIOLATION SYSTEM

Every check must use:

`Buffer → VL → Decay → Confidence → Punishment`

Example:

```yaml
checks:
  fly:
    enabled: true
    buffer: 5
    decay: 0.25
    punish-vl: 20

  reach:
    enabled: true
    buffer: 10
    decay: 0.20
    punish-vl: 30

  killaura:
    enabled: true
    buffer: 8
    decay: 0.20
    punish-vl: 30

  triggerbot:
    enabled: true
    buffer: 8
    decay: 0.25
    punish-vl: 30
```

All values must be configurable.

---

# 10. AUTOMATIC PUNISHMENT

Create a completely customizable punishment system.

Example:

```yaml
punishments:
  fly:
    enabled: true
    threshold: 20
    commands:
      - "tempban %player% 1d [BossAC] Fly"

  killaura:
    enabled: true
    threshold: 30
    commands:
      - "tempban %player% 7d [BossAC] KillAura"

  reach:
    enabled: true
    threshold: 30
    commands:
      - "tempban %player% 7d [BossAC] Reach"

  triggerbot:
    enabled: true
    threshold: 30
    commands:
      - "tempban %player% 7d [BossAC] TriggerBot"
```

Support:

- Ban
- Tempban
- Kick
- Mute
- Custom commands
- Multiple commands
- Different punishment per check

Never automatically punish from one weak detection.

---

# 11. STAFF COMMAND SYSTEM

Create the following commands:

### Main command

`/bossanticheat`

Aliases:

`/bac`

### Commands

```text
/bossanticheat
/bossanticheat alerts
/bossanticheat verbose
/bossanticheat info 
/bossanticheat violations 
/bossanticheat reload
/bossanticheat debug 
/bossanticheat logs
/bossanticheat punish 
/bossanticheat offhand 
```

Aliases must also work:

```text
/bac
/bac alerts
/bac verbose
/bac info 
/bac violations 
/bac reload
/bac debug 
/bac logs
/bac punish 
/bac offhand 
```

Also create:

```text
/punish  
```

The `/punish` command must integrate with the Boss Anti Cheat punishment system.

---

# 12. OFFHAND SYSTEM

Create:

```text
/bac offhand 
```

This should allow authorized staff to manage/view the player's offhand state according to the configured functionality.

The offhand feature must be completely configurable.

Do not allow ordinary players to use it.

---

# 13. PERMISSION SYSTEM — VERY IMPORTANT

Every administrative command MUST require a permission.

Do NOT allow commands to work merely because a player knows the command.

Suggested permissions:

```text
bossac.admin
bossac.alerts
bossac.verbose
bossac.info
bossac.violations
bossac.reload
bossac.debug
bossac.logs
bossac.punish
bossac.offhand
bossac.bypass
bossac.bypass.*
```

Suggested command mapping:

```text
/bossanticheat
    bossac.admin

/bossanticheat alerts
    bossac.alerts

/bossanticheat verbose
    bossac.verbose

/bossanticheat info
    bossac.info

/bossanticheat violations
    bossac.violations

/bossanticheat reload
    bossac.reload

/bossanticheat debug
    bossac.debug

/bossanticheat logs
    bossac.logs

/bossanticheat punish
    bossac.punish

/bossanticheat offhand
    bossac.offhand

/punish
    bossac.punish
```

The permission names MUST be configurable if possible.

---

# 14. NO-PERMISSION MESSAGE

If a player does not have the required permission, the command MUST NOT execute.

Send:

`You don't have access to this command.`

Make this message completely configurable:

```yaml
messages:
  no-permission: "&cYou don't have access to this command."
```

Allow administrators to customize every command message.

---

# 15. STAFF BYPASS

Add:

```text
bossac.bypass
```

Players with this permission must not receive anti-cheat punishment.

Also support per-check bypass:

```text
bossac.bypass.fly
bossac.bypass.killaura
bossac.bypass.reach
bossac.bypass.triggerbot
bossac.bypass.speed
...
```

Support:

```text
bossac.bypass.*
```

for all checks.

Make bypass behavior configurable.

---

# 16. ALERTS

Staff alerts should look like:

```text
[BossAC] Player failed KillAura
VL: 18.5
Ping: 82ms
Confidence: 97%
```

Reach:

```text
[BossAC] Player failed Reach
VL: 12.0
Reach: 4.12
Allowed: 3.65
Ping: 235ms
Confidence: 94%
```

TriggerBot:

```text
[BossAC] Player failed TriggerBot
VL: 14.2
Reaction: 12ms
Ping: 61ms
Confidence: 98%
```

Alerts must only be sent to players who have the appropriate permission.

---

# 17. LOGGING SYSTEM

Create a complete logging system.

Log:

- Player
- Check
- VL
- Ping
- Confidence
- Detection information
- Location where appropriate
- Timestamp
- Punishment
- Staff actions

Create configurable log files.

Example:

```text
/plugins/BossAntiCheat/logs/
    violations.log
    punishments.log
    staff.log
    debug.log
```

The `/bac logs` command must require:

```text
bossac.logs
```

Allow administrators to configure:

- What gets logged
- Log retention
- Maximum log size
- Automatic old-log cleanup
- Debug logging
- Console logging

---

# 18. PUNISHMENT LOGGING

Every punishment must be recorded.

Example:

```text
[2026-08-20 18:30:12]
Player: ExamplePlayer
Check: Fly
VL: 24.5
Confidence: 99%
Ping: 54ms
Punishment: TempBan 1d
```

Staff-issued punishments must also be logged.

---

# 19. FULL CUSTOMIZATION

The entire plugin must be customizable.

Configuration must cover:

- Checks
- Sensitivity
- VL
- Buffers
- Decay
- Confidence
- Ping compensation
- High-ping behavior
- Punishments
- Commands
- Messages
- Permissions
- Alerts
- Logs
- Debug
- INVENTORY GUI
- INVENTORY GUI names
- INVENTORY GUI items
- INVENTORY GUI descriptions
- INVENTORY GUI sounds
- Staff settings
- TPS protection
- False-positive protection

Administrators should NOT need to modify Java source code for normal configuration.

---

# 20. INVENTORY GUI

Create an admin INVENTORY GUI similar to the provided reference screenshots.

Categories:

- Combat
- Movement
- Player
- Configuration
- Punishments
- Alerts
- Logs

Display every check with:

- Enabled/Disabled
- VL
- Buffer
- Confidence
- Punishment status

Allow authorized administrators to change appropriate settings through INVENTORY GUI if implemented.

INVENTORY GUI access must require:

```text
bossac.admin
```

---

# 21. PERFORMANCE

Optimize for large servers.

Requirements:

- Avoid unnecessary repeating tasks
- Avoid expensive calculations every tick for every player
- Cache player data
- Clean player data on quit
- Avoid memory leaks
- Optimize collision/ray tracing
- Use efficient data structures
- Process packets efficiently
- Async processing only where Bukkit/Paper API safety permits

Never perform unsafe Bukkit API calls asynchronously.

Target minimal TPS impact.

---

# 22. CONFIG FILE STRUCTURE

Generate complete configuration files:

```text
config.yml
checks.yml
punishments.yml
messages.yml
permissions.yml
logging.yml
INVENTORY GUI.yml
```

If separating files makes the plugin cleaner, use separate configuration files.

Every important value must be editable.

---

# 23. COMMAND TAB COMPLETION

Implement tab completion for:

```text
/bossanticheat
/bac
/punish
```

Only suggest commands that the player has permission to use.

Do not reveal restricted administrative commands to players who do not have permission.

---

# 24. SECURITY

Never trust client-side information.

Never allow a player to:

- Modify VL
- Disable checks
- View private logs
- Punish players
- Use offhand staff tools
- Toggle alerts
- Reload configuration

without the required permission.

Permission checks must happen server-side for every protected command.

---

# 25. FINAL DELIVERABLE

Generate a complete working plugin project containing:

- plugin.yml
- Java source
- CheckManager
- Combat checks
- Movement checks
- Player checks
- Packet framework
- LatencyManager
- ViolationManager
- PunishmentManager
- PermissionManager
- AlertManager
- LoggingManager
- FalsePositiveManager
- INVENTORY GUI
- Commands
- Tab completion
- Configuration system
- All configuration files
- README
- Build configuration

Do not leave TODO placeholders for core functionality.

Do not create fake detection logic.

Do not use simplistic checks such as:

```text
if ping > 200 = ignore player
```

or:

```text
if distance > 3 = Reach
```

Use actual movement state, packet timing, historical positions, collision data, rotation, attack timing, server TPS and latency compensation.

The final plugin name must be:

**Boss Anti Cheat**

Short name:

**BAC**

Make the project clean, modular, production-ready and easy to expand with additional checks in the future.
Kodari AI
KodariAug 22 at 10:00 am 19

Created the Boss Anti Cheat (BAC) Paper/Purpur project with:

  • Java 21 Gradle build, plugin descriptor, and configurable resource files.

  • Modular latency, false-positive, violation, alerts, permissions, punishment, logging, command, and GUI systems.

  • Latency-aware reach reconstruction, rolling TriggerBot/AutoClicker analysis, KillAura signals, movement timing, flight, speed, VClip, invalid rotation, and interaction-rate checks.

  • Permission-gated /bossanticheat / /bac and /punish commands with restricted tab completion.

  • Configurable staff GUI for category browsing and check enable toggles.

  • Separate check, punishment, messages, permissions, logging, latency, and GUI configuration files.

  • README covering build, command, detection, and configuration behavior.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle.kts
README.md
settings.gradle.kts
Code
29 1,188
src/main/java/com/bossac/BossAntiCheat.java
package com.bossac;

import com.bossac.command.BossAntiCheatCommand;
import com.bossac.config.ConfigManager;
import com.bossac.gui.AdminGui;
import com.bossac.manager.AlertManager;
import com.bossac.manager.FalsePositiveManager;
import com.bossac.manager.LatencyManager;
import com.bossac.manager.LoggingManager;
import com.bossac.manager.PermissionManager;
import com.bossac.manager.PunishmentManager;
import com.bossac.manager.ViolationManager;
import com.bossac.check.CheckEngine;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class BossAntiCheat extends JavaPlugin {
    private ConfigManager configManager;
    private PermissionManager permissionManager;
    private LatencyManager latencyManager;
    private FalsePositiveManager falsePositiveManager;
    private LoggingManager loggingManager;
    private AlertManager alertManager;
    private PunishmentManager punishmentManager;
    private ViolationManager violationManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.configManager.load();
        this.permissionManager = new PermissionManager(this);
        this.latencyManager = new LatencyManager(this);
        this.falsePositiveManager = new FalsePositiveManager(this);
        this.loggingManager = new LoggingManager(this);
        this.alertManager = new AlertManager(this);
        this.punishmentManager = new PunishmentManager(this);
        this.violationManager = new ViolationManager(this);

        getServer().getPluginManager().registerEvents(latencyManager, this);
        getServer().getPluginManager().registerEvents(falsePositiveManager, this);
        getServer().getPluginManager().registerEvents(new CheckEngine(this), this);
        getServer().getPluginManager().registerEvents(new AdminGui(this), this);

        BossAntiCheatCommand command = new BossAntiCheatCommand(this);
        PluginCommand mainCommand = getCommand("bossanticheat");
        PluginCommand punishCommand = getCommand("punish");
        if (mainCommand != null) {
            mainCommand.setExecutor(command);
            mainCommand.setTabCompleter(command);
        }
        if (punishCommand != null) {
            punishCommand.setExecutor(command);
            punishCommand.setTabCompleter(command);
        }
        getLogger().info("Boss Anti Cheat enabled.");
    }

    @Override
    public void onDisable() {
        if (loggingManager != null) {
            loggingManager.close();
        }
    }

    public ConfigManager getConfigManager() { return configManager; }
    public PermissionManager getPermissionManager() { return permissionManager; }
    public LatencyManager getLatencyManager() { return latencyManager; }
    public FalsePositiveManager getFalsePositiveManager() { return falsePositiveManager; }
    public LoggingManager getLoggingManager() { return loggingManager; }
    public AlertManager getAlertManager() { return alertManager; }
    public PunishmentManager getPunishmentManager() { return punishmentManager; }
    public ViolationManager getViolationManager() { return violationManager; }
}