Landon James
📎 1 file 2,722 chars
📄
pasted-code-1790467818242.txt
txt 112 lines
▶
Create a complete Minecraft Java anti-cheat plugin for **Minecraft 1.21.11** running on **Paper or Purpur**.

I do NOT know how to code, so generate everything needed and compile it into a working `.jar` plugin if your platform supports compilation.

Plugin name: **VortexGuard**

### Main goal

Create a lightweight but effective anti-cheat for my SMP/PvP server.

### Detect:

* Fly / abnormal movement
* Speed
* KillAura
* Reach
* AutoClicker
* NoFall
* FastPlace
* FastBreak
* Jesus
* Spider
* Scaffold
* Inventory movement
* Impossible rotations
* Basic combat and movement anomalies

### Anti-Xray

Include an anti-Xray system if possible. It should prevent players from easily using X-ray resource packs to locate valuable ores.

If Paper/Purpur's built-in Anti-Xray is better for this, do NOT try to replace it. Instead, make the plugin compatible with the server's built-in Anti-Xray.

### Punishments

Use a violation-level system.

When a player is detected:

* First violations: silently increase their violation level
* Repeated violations: warn staff
* Severe/repeated violations: kick the player
* Only automatically ban when the evidence is extremely strong
* Never punish based on a single suspicious action

Add configurable punishment thresholds.

### Staff commands

Add:

/vg alerts
/vg check 
/vg violations 
/vg reset 
/vg reload
/vg version

Only operators or players with the appropriate permission should use staff commands.

### Alerts

Send staff alerts like:

[VortexGuard] PlayerName suspected of Speed (VL: 8)

Make alerts toggleable with:

/vg alerts

### Permissions

Create permissions such as:

vortexguard.alerts
vortexguard.check
vortexguard.reset
vortexguard.reload
vortexguard.bypass

### Configuration

Create a simple config.yml where I can change:

* Detection sensitivity
* Violation thresholds
* Punishments
* Messages
* Alert settings
* Bypass permissions
* Whether individual checks are enabled

### Important

Minimize false positives. Do NOT punish players for normal lag, high ping, server lag, knockback, elytra, vehicles, teleporting, or legitimate server mechanics.

Make the plugin lightweight and avoid causing noticeable TPS drops.

Make sure it is compatible with **Minecraft 1.21.11 Paper/Purpur**.

Generate:

1. Complete source code
2. plugin.yml
3. config.yml
4. build files
5. Any required classes/resources
6. A compiled `.jar` if your platform supports it
7. Clear installation instructions for a beginner

Do not leave TODOs, placeholders, or unfinished functions. Test the project/build before giving me the final plugin.
Kodari AI
KodariSep 27 at 12:13 am 2
VortexGuard
A lightweight anti-cheat plugin for Paper/Purpur 1.21.11 with violation-based detection across 12+ checks including movement, combat, and block manipulation. Features configurable thresholds, staff alert system with toggleable notifications, comprehensive staff commands for checking and resetting violations, and full compatibility with Paper's built-in anti-Xray. Includes bypass permissions, sensitivity tuning, and lag compensation to minimize false positives while maintaining server performance.
  1. Create the Gradle/Paper project, plugin metadata, and beginner installation guide.

  2. Implement configurable movement, combat, and block-placement/break checks with violation decay and escalating punishments.

  3. Add permission-gated /vg staff commands and Paper built-in Anti-Xray guidance.

Created VortexGuard’s Gradle/Paper project with configurable movement, combat, and block-action checks; violation alerts and escalating kicks; permission-gated /vg commands; and beginner build and installation instructions.

Paper/Purpur’s built-in Anti-Xray is recommended instead of duplicating ore obfuscation. Automatic bans are disabled by default, and NoFall detection is also off by default to reduce false positives.

A prebuilt .jar is not attached, and I couldn’t run a build here. To create it, run gradle build; the JAR will be at build/libs/VortexGuard-1.0.0.jar. The checks are heuristic, so review alerts and tune thresholds for your server before enabling punishments.

[Generation stopped]

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
settings.gradle
Code
12 913
src/main/java/com/vortexguard/VortexGuardPlugin.java
package com.vortexguard;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Objects;

public final class VortexGuardPlugin extends JavaPlugin {
    private ViolationManager violationManager;
    private volatile boolean serverLagging;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        violationManager = new ViolationManager(this);
        updateServerLoad();

        Bukkit.getPluginManager().registerEvents(new MovementCheckListener(this), this);
        Bukkit.getPluginManager().registerEvents(new CombatCheckListener(this), this);
        Bukkit.getPluginManager().registerEvents(new BlockCheckListener(this), this);

        VortexGuardCommand command = new VortexGuardCommand(this);
        Objects.requireNonNull(getCommand("vg"), "vg command missing from plugin.yml").setExecutor(command);
        getCommand("vg").setTabCompleter(command);

        Bukkit.getScheduler().runTaskTimer(this, violationManager::decay, 1200L, 1200L);
        Bukkit.getScheduler().runTaskTimer(this, this::updateServerLoad, 20L, 20L);
        getLogger().info("VortexGuard enabled.");
    }

    public ViolationManager getViolationManager() {
        return violationManager;
    }

    public boolean isCheckEnabled(CheckType check) {
        return getConfig().getBoolean("checks." + check.getConfigKey() + ".enabled", true);
    }

    public boolean isBypassing(Player player) {
        String permission = getConfig().getString("bypass-permission", "vortexguard.bypass");
        return permission != null && !permission.isBlank() && player.hasPermission(permission);
    }

    public boolean isServerLagging() {
        return serverLagging;
    }

    private void updateServerLoad() {
        double[] tps = Bukkit.getTPS();
        serverLagging = tps.length > 0 && tps[0] < getConfig().getDouble("exemptions.minimum-tps", 18.0);
    }
}