Tester Tired

I want a Minecraft Java Edition (Paper/Spigot) Anti-ESP plugin with the following behavior:

Core System:

  • Prevent players from identifying hidden chests and spawners through X-ray or ESP resource packs.
  • Hide protected container and spawner information when viewed through solid blocks.
  • Normal rendering and interactions must work when blocks are legitimately visible.
  • Support configurable protected block types.
  • Optimize performance for multiplayer servers.

IMPORTANT ACTIVATION RULES:

  • The anti-ESP system must remain inactive when the player's Y-coordinate is above -1.
  • The anti-ESP system must activate when the player's Y-coordinate reaches -1 or below.
  • Check the player's current position and update the system when crossing the Y=-1 boundary.
  • Make the activation threshold configurable.

COMPATIBILITY:

  • Minecraft Java Edition 1.21.11.
  • Paper/Spigot server API.
  • Include a configuration file, clear installation instructions, and error handling.

IMPORTANT:

  • Do not break normal gameplay.
  • Do not reveal protected blocks through particle effects or other visual indicators.
  • Include comments explaining the implementation.
Kodari AI
KodariOct 31 at 2:06 pm 1
AntiEspProtector
AntiEspProtector is a Paper/Spigot plugin that prevents players from identifying hidden chests and spawners through X-ray or ESP resource packs. It hides protected container and spawner information when viewed through solid blocks while preserving normal rendering and interactions for legitimately visible blocks. The system activates only when a player's Y-coordinate reaches or falls below a configurable threshold (default: -1), checking player position and updating state when crossing the boundary. It supports configurable protected block types, optimizes performance for multiplayer servers, and includes a configuration file with clear installation instructions and error handling. The plugin does not break normal gameplay and never reveals protected blocks through particle effects or visual indicators.
  1. Create the plugin setup, configuration, and installation guide.

  2. Track configured protected blocks as chunks load or blocks change.

  3. Apply per-player fake block states below the configurable Y threshold, restoring real states when visible or inactive.

  4. Register lifecycle and block events, with periodic movement-based updates to limit overhead.

Created the AntiESP plugin with configurable protected blocks and a Y activation threshold (default -1). It masks concealed blocks per player, restores their real block states when visible or when protection is inactive, and updates on movement and chunk changes.

The project includes config.yml, Paper/Spigot plugin metadata, and installation instructions in README.md.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
settings.gradle
Code
10 634
src/main/java/com/kodari/antiesp/AntiEspPlugin.java
package com.kodari.antiesp;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashSet;
import java.util.Set;

public final class AntiEspPlugin extends JavaPlugin {
    private PlayerProtectionService protectionService;

    @Override
    public void onEnable() {
        try {
            saveDefaultConfig();
            Set<XMaterial> protectedMaterials = loadProtectedMaterials();

            String fakeBlockName = getConfig().getString("fake-block", "STONE");
            Material fakeMaterial = XMaterial.matchXMaterial(fakeBlockName == null ? "STONE" : fakeBlockName)
                    .map(XMaterial::parseMaterial)
                    .orElse(null);
            if (fakeMaterial == null || !fakeMaterial.isOccluding()) {
                getLogger().warning("The configured fake-block is missing or not opaque; using STONE instead.");
                fakeMaterial = XMaterial.matchXMaterial("STONE").map(XMaterial::parseMaterial).orElse(null);
            }
            if (fakeMaterial == null) {
                throw new IllegalStateException("Could not resolve the fallback STONE fake block.");
            }

            int activationY = getConfig().getInt("activation-y", -1);
            int refreshInterval = getConfig().getInt("refresh-interval-ticks", 10);
            if (refreshInterval < 1) {
                getLogger().warning("refresh-interval-ticks must be at least 1; using 10.");
                refreshInterval = 10;
            }
            int radiusChunks = getConfig().getInt("scan-radius-chunks", 12);
            if (radiusChunks < 1 || radiusChunks > 32) {
                getLogger().warning("scan-radius-chunks must be between 1 and 32; using 12.");
                radiusChunks = 12;
            }

            ProtectedBlockTracker tracker = new ProtectedBlockTracker(protectedMaterials);
            BlockData fakeBlockData = Bukkit.createBlockData(fakeMaterial);
            protectionService = new PlayerProtectionService(this, tracker, fakeBlockData, activationY,
                    radiusChunks, refreshInterval);
            Bukkit.getPluginManager().registerEvents(new AntiEspListener(tracker, protectionService), this);
            protectionService.start();

            if (protectedMaterials.isEmpty()) {
                getLogger().warning("No valid protected-block types were configured; AntiESP will not mask blocks.");
            }
            getLogger().info("AntiESP enabled; protection activates at Y=" + activationY + " and below.");
        } catch (RuntimeException exception) {
            getLogger().severe("AntiESP could not start: " + exception.getMessage());
            exception.printStackTrace();
            Bukkit.getPluginManager().disablePlugin(this);
        }
    }

    @Override
    public void onDisable() {
        if (protectionService != null) {
            protectionService.shutdown();
        }
    }

    private Set<XMaterial> loadProtectedMaterials() {
        Set<XMaterial> materials = new HashSet<>();
        for (String name : getConfig().getStringList("protected-blocks")) {
            XMaterial.matchXMaterial(name).ifPresentOrElse(
                    materials::add,
                    () -> getLogger().warning("Skipping unknown protected block type: " + name));
        }
        return materials;
    }
}