Sushma Singh

Give me free polar anticheat 1.21.11

Kodari AI
KodariOct 6 at 11:03 pm 1
PolarAnticheat
PolarAnticheat is a comprehensive anti-cheat plugin for Minecraft servers, providing real-time detection and prevention of unfair gameplay advantages. It monitors player movements, combat patterns, and block interactions to identify suspicious behavior. The plugin includes configurable checks for fly, speed, killaura, reach, and other common hacks, with automatic flagging and punishment systems. It features a user-friendly GUI for managing alerts, exemptions, and punishment severity, alongside a detailed logging system for evidence tracking. Administrators can customize detection sensitivity, whitelist trusted players, and receive instant notifications through in-game chat and console. The plugin is designed for performance efficiency, ensuring minimal server lag while maintaining robust protection against cheating.

I’ll create an original, free Paper 1.21.11 anticheat with conservative reach alerts; it won’t be Polar Anticheat or a copy of it.

Created AegisLite, an original free Paper 1.21.11 plugin—not Polar Anticheat or a copy. It flags unusually long hits to staff and logs them; it does not automatically punish players. Use /aegis alerts to toggle alerts. The reach limit and alert cooldown are configurable in config.yml.

To get the jar, click Compile in the top bar, then Compile in the window and Download when it succeeds.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
4 143
src/main/java/com/kodari/aegislite/AegisLitePlugin.java
package com.kodari.aegislite;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.util.BoundingBox;

public final class AegisLitePlugin extends org.bukkit.plugin.java.JavaPlugin implements Listener, CommandExecutor {
    private final Map<UUID, Long> lastAlertTimes = new HashMap<>();
    private final Set<UUID> alertsDisabled = new HashSet<>();

    @Override
    public void onEnable() {
        saveDefaultConfig();
        Bukkit.getPluginManager().registerEvents(this, this);
        getCommand("aegis").setExecutor(this);
    }

    @EventHandler(ignoreCancelled = true)
    public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
        if (!(event.getDamager() instanceof Player attacker)) {
            return;
        }

        Entity target = event.getEntity();
        double reach = distanceToBoundingBox(attacker.getEyeLocation(), target.getBoundingBox());
        double maximumReach = getConfig().getDouble("max-reach", 4.0);
        if (reach <= maximumReach) {
            return;
        }

        long now = System.currentTimeMillis();
        long cooldown = getConfig().getLong("alert-cooldown-ms", 1500L);
        long lastAlert = lastAlertTimes.getOrDefault(attacker.getUniqueId(), 0L);
        if (now - lastAlert < cooldown) {
            return;
        }
        lastAlertTimes.put(attacker.getUniqueId(), now);

        String alert = String.format(Locale.US,
                "&c[AegisLite] &f%s &7hit %s at &c%.2f &7blocks (limit %.2f).",
                attacker.getName(), target.getName(), reach, maximumReach);
        for (Player staff : Bukkit.getOnlinePlayers()) {
            if (staff.hasPermission("aegislite.alerts") && !alertsDisabled.contains(staff.getUniqueId())) {
                staff.sendMessage(alert.replace('&', '§'));
            }
        }
        getLogger().info(String.format(Locale.US,
                "%s hit %s at %.2f blocks (limit %.2f)",
                attacker.getName(), target.getName(), reach, maximumReach));
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        UUID playerId = event.getPlayer().getUniqueId();
        lastAlertTimes.remove(playerId);
        alertsDisabled.remove(playerId);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length != 1 || !args[0].equalsIgnoreCase("alerts")) {
            sender.sendMessage("§eUsage: /aegis alerts");
            return true;
        }
        if (!(sender instanceof Player player)) {
            sender.sendMessage("This command can only be used in-game.");
            return true;
        }

        UUID playerId = player.getUniqueId();
        if (alertsDisabled.remove(playerId)) {
            player.sendMessage("§aAegisLite alerts enabled.");
        } else {
            alertsDisabled.add(playerId);
            player.sendMessage("§cAegisLite alerts disabled.");
        }
        return true;
    }

    private double distanceToBoundingBox(Location point, BoundingBox box) {
        double dx = Math.max(Math.max(box.getMinX() - point.getX(), 0.0), point.getX() - box.getMaxX());
        double dy = Math.max(Math.max(box.getMinY() - point.getY(), 0.0), point.getY() - box.getMaxY());
        double dz = Math.max(Math.max(box.getMinZ() - point.getZ(), 0.0), point.getZ() - box.getMaxZ());
        return Math.sqrt(dx * dx + dy * dy + dz * dz);
    }
}