night_hyperion

a 1.21 paper plugin which detects popular freecam and mini map mods or uses a detection system to stop it like a advanced detection system where if they cant see it with their eyes then it shows as bedrock or smt but just to stop freecam and minimap

Kodari AI
KodariMar 18 at 9:07 pm 16,064 (v2)

I’ll create an advanced anti-cheat plugin that prevents freecam and minimap exploitation through packet manipulation and obfuscation.

FreecamBlocker
Advanced protection system against freecam and minimap mods using intelligent block obfuscation and entity hiding. Hides blocks and entities not in direct line of sight by replacing them with bedrock or air. Detects suspicious movement patterns indicating freecam usage and alerts administrators. Features configurable detection sensitivity, automatic violation tracking, and comprehensive logging with admin notification system.

Perfect! I’ve created a comprehensive anti-freecam and anti-minimap plugin with advanced detection and obfuscation systems.

Key Features:

  1. Freecam Detection - Monitors suspicious movement patterns, camera desync, spectate packets, and look-only packets

  2. Block Obfuscation - Hides blocks behind walls/underground by sending fake bedrock packets (players can’t see ores/bases through walls)

  3. Entity Hiding - Hides players and mobs not in direct line of sight (prevents minimap radar)

  4. Raytrace System - Uses Minecraft’s raytrace API to determine actual visibility

  5. Violation Tracking - Tracks violations with automatic timeout and kick on threshold

  6. Admin Alerts - Real-time notifications with sound when violations detected

  7. Folia Support - Full FoliaLib integration for thread-safe operations

  8. ProtocolLib Integration - Packet manipulation for seamless obfuscation

Commands:

  • /fcb reload - Reload config

  • /fcb toggle - Enable/disable detection

  • /fcb violations - View violation report

  • /fcb reset <player> - Reset player violations

Permissions:

  • freecamblocker.admin - Access commands

  • freecamblocker.bypass - Bypass all detection

  • freecamblocker.alerts - Receive violation alerts

The plugin uses smart raytrace detection to only hide what players legitimately can’t see, making freecam/minimap mods useless while keeping legitimate gameplay unaffected.

night_hyperion

The compilation failed with this error:

code
Compilation failed with 8 error(s):

ERROR in src/main/java/com/freecamblocker/manager/ObfuscationManager.java at line 159: exception InvocationTargetException is never thrown in body of corresponding try statement
        } catch (InvocationTargetException e) {
          ^

ERROR in src/main/java/com/freecamblocker/manager/ObfuscationManager.java at line 174: exception InvocationTargetException is never thrown in body of corresponding try statement
        } catch (InvocationTargetException e) {
          ^

ERROR in src/main/java/com/freecamblocker/manager/ObfuscationManager.java at line 245: exception InvocationTargetException is never thrown in body of corresponding try statement
        } catch (InvocationTargetException e) {
          ^

ERROR in src/main/java/com/freecamblocker/listener/PacketListener.java at line 36: cannot find symbol
                    if (!plugin.getConfigManager().isDetectionEnabled()) {
                               ^
  symbol: method getConfigManager()
  location: variable plugin of type Plugin

ERROR in src/main/java/com/freecamblocker/listener/PacketListener.java at line 40: cannot find symbol
                    PlayerData data = plugin.getPlayerDataManager().getPlayerData(player.getUniqueId());
                                            ^
  symbol: method getPlayerDataManager()
  location: variable plugin of type Plugin

ERROR in src/main/java/com/freecamblocker/listener/PacketListener.java at line 49: cannot find symbol
                                plugin.getAlertManager().debug(
                                      ^
  symbol: method getAlertManager()
  location: variable plugin of type Plugin

ERROR in src/main/java/com/freecamblocker/listener/PacketListener.java at line 72: cannot find symbol
                    PlayerData data = plugin.getPlayerDataManager().getPlayerData(player.getUniqueId());
                                            ^
  symbol: method getPlayerDataManager()
  location: variable plugin of type Plugin

ERROR in src/main/java/com/freecamblocker/listener/PacketListener.java at line 75: cannot find symbol
                    plugin.getAlertManager().debug(
                          ^
  symbol: method getAlertManager()
  location: variable plugin of type Plugin


=== COMPILATION ERROR ANALYSIS ===

MISSING METHODS:
  - getConfigManager()
  - getPlayerDataManager()
  - getAlertManager()
ACTION: Check method names and signatures

FILES TO INVESTIGATE:
  - src/main/java/com/freecamblocker/manager/ObfuscationManager.java
  - src/main/java/com/freecamblocker/listener/PacketListener.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariMar 18 at 10:25 pm 10,153 (v2)

I need to read the files to understand the current state and fix the compilation errors.

I can see the issues:

  1. PacketListener: Inside the anonymous PacketAdapter classes, plugin refers to PacketAdapter’s plugin field (type Plugin), not PacketListener’s field (type FreecamBlocker)

  2. ObfuscationManager: The InvocationTargetException catches are unnecessary - ProtocolLib’s sendServerPacket() doesn’t actually throw checked exceptions in newer versions

Let me fix both issues:

Fixed the compilation errors by:

  1. Using PacketListener.this.plugin to access the outer class’s FreecamBlocker instance inside anonymous PacketAdapter classes

  2. Changing InvocationTargetException catches to general Exception in ObfuscationManager

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
14 1,066
src/main/java/com/freecamblocker/FreecamBlocker.java
package com.freecamblocker;

import com.cryptomorin.xseries.XSound;
import com.freecamblocker.command.FreecamCommand;
import com.freecamblocker.listener.PacketListener;
import com.freecamblocker.listener.PlayerListener;
import com.freecamblocker.manager.AlertManager;
import com.freecamblocker.manager.ConfigManager;
import com.freecamblocker.manager.DetectionManager;
import com.freecamblocker.manager.ObfuscationManager;
import com.freecamblocker.manager.PlayerDataManager;
import com.tcoded.folialib.FoliaLib;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public final class FreecamBlocker extends JavaPlugin {

    private FoliaLib foliaLib;
    private ConfigManager configManager;
    private PlayerDataManager playerDataManager;
    private DetectionManager detectionManager;
    private ObfuscationManager obfuscationManager;
    private AlertManager alertManager;

    @Override
    public void onEnable() {
        foliaLib = new FoliaLib(this);
        
        if (!setupProtocolLib()) {
            getLogger().severe("ProtocolLib not found! Plugin requires ProtocolLib to function.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        configManager = new ConfigManager(this);
        playerDataManager = new PlayerDataManager(this);
        alertManager = new AlertManager(this);
        detectionManager = new DetectionManager(this);
        obfuscationManager = new ObfuscationManager(this);

        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
        new PacketListener(this);

        getCommand("freecamblocker").setExecutor(new FreecamCommand(this));

        getLogger().info("FreecamBlocker has been enabled!");
        getLogger().info("Freecam detection: " + (configManager.isFreecamDetectionEnabled() ? "ENABLED" : "DISABLED"));
        getLogger().info("Minimap protection: " + (configManager.isMinimapDetectionEnabled() ? "ENABLED" : "DISABLED"));
        getLogger().info("Block obfuscation: " + (configManager.isObfuscationEnabled() ? "ENABLED" : "DISABLED"));
    }

    @Override
    public void onDisable() {
        if (foliaLib != null) {
            foliaLib.getScheduler().cancelAllTasks();
        }
        if (obfuscationManager != null) {
            obfuscationManager.cleanup();
        }
        if (playerDataManager != null) {
            playerDataManager.cleanup();
        }
        getLogger().info("FreecamBlocker has been disabled!");
    }

    private boolean setupProtocolLib() {
        return getServer().getPluginManager().getPlugin("ProtocolLib") != null;
    }

    public void reload() {
        configManager.reload();
        obfuscationManager.reload();
        detectionManager.reload();
    }
}