leo flanagan

make a paper 1.21.11 plugin that makes chests echests and enchant tables disapear if they are 30 blocks from a player to make esp not work

Kodari AI
KodariOct 20 at 4:19 pm 1
ProximityVanish
ProximityVanish is a Paper plugin for Minecraft 1.21.1 that prevents ESP cheating by hiding essential blocks from players based on proximity. Chests, ender chests, and enchanting tables automatically become invisible when they are within 30 blocks of any player, and reappear when the player moves away. The plugin runs a continuous tick-based task that scans loaded chunks, calculates block-to-player distances, and sends block destroy/update packets to hide or reveal blocks in real-time. It respects player permissions, has a configurable radius setting, and ensures seamless server-side synchronization when blocks are modified by other players or plugins. Works entirely on the client visual layer without affecting actual block states or world data.
  1. Create the Paper 1.21.11 plugin metadata and Java 21 build setup.

  2. Index loaded chunks for chests, ender chests, and enchanting tables; mask those blocks client-side beyond 30 blocks and restore them when nearby.

Created BlockVeil, a Paper 1.21.11 plugin that client-side hides chests, trapped chests, ender chests, and enchanting tables more than 30 blocks away, then restores them when players get closer. The server’s actual blocks remain unchanged.

leo flanagan

make a 1.21.11 paper plugin that makes freecam not work at all, on all versions of freecam for it to just not work

Kodari AI
KodariOct 20 at 4:25 pm 1
  1. Replace the block-hiding behavior and metadata with a focused FreecamGuard plugin.

  2. Reject block and entity actions whose targets are more than six blocks from the server-side player.

  3. Keep the limitation explicit: a server plugin cannot universally disable a camera-only client mod, but it can prevent remote actions.

Replaced BlockVeil with FreecamGuard. It cancels block interactions, breaking, placing, entity interactions, and direct player attacks when the target is more than six blocks from the player’s server-side position.

A plugin cannot universally disable a freecam camera that runs entirely on the client; it can only enforce server-side rules. This plugin restricts remote actions, but players may still use freecam to look around locally.

leo flanagan

i just need people to stop finding bases with freecma

Kodari AI
KodariOct 20 at 4:33 pm 1

I’ll switch the plugin back from remote-action blocking to client-side masking of base storage blocks beyond 30 blocks, so they won’t render for a scouting freecam. This can hide common loot containers, but can’t stop freecam from viewing terrain or other visible structures.

The plugin now masks chests, trapped chests, ender chests, barrels, and shulker boxes as air for players more than 30 blocks away, restoring them when they get closer. This targets common base-loot ESP, but freecam can still reveal terrain and visible structures.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 241
src/main/java/com/kodari/blockveil/BlockVeilPlugin.java
package com.kodari.blockveil;

import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.block.BlockState;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.event.world.ChunkUnloadEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

public final class BlockVeilPlugin extends JavaPlugin implements Listener {
    private static final double HIDE_DISTANCE = 30.0;
    private static final double HIDE_DISTANCE_SQUARED = HIDE_DISTANCE * HIDE_DISTANCE;

    private final Map<ChunkKey, Set<BlockKey>> blocksByChunk = new HashMap<>();
    private final Map<UUID, Set<BlockKey>> concealedByPlayer = new HashMap<>();
    private BlockData air;

    @Override
    public void onEnable() {
        air = Bukkit.createBlockData("minecraft:air");
        getServer().getPluginManager().registerEvents(this, this);
        for (org.bukkit.World world : Bukkit.getWorlds()) {
            for (Chunk chunk : world.getLoadedChunks()) {
                indexChunk(chunk);
            }
        }
        getServer().getScheduler().runTaskTimer(this, this::refreshPlayers, 1L, 10L);
    }

    @EventHandler
    public void onChunkLoad(ChunkLoadEvent event) {
        indexChunk(event.getChunk());
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onChunkUnload(ChunkUnloadEvent event) {
        ChunkKey chunkKey = new ChunkKey(event.getWorld().getUID(), event.getChunk().getX(), event.getChunk().getZ());
        Set<BlockKey> removed = blocksByChunk.remove(chunkKey);
        if (removed != null) {
            for (Set<BlockKey> concealed : concealedByPlayer.values()) {
                concealed.removeAll(removed);
            }
        }
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onBlockPlace(BlockPlaceEvent event) {
        scheduleBlockRefresh(event.getBlockPlaced());
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onBlockBreak(BlockBreakEvent event) {
        scheduleBlockRefresh(event.getBlock());
    }

    @EventHandler
    public void onQuit(PlayerQuitEvent event) {
        concealedByPlayer.remove(event.getPlayer().getUniqueId());
    }

    private void indexChunk(Chunk chunk) {
        ChunkKey chunkKey = new ChunkKey(chunk.getWorld().getUID(), chunk.getX(), chunk.getZ());
        Set<BlockKey> positions = new HashSet<>();
        for (BlockState state : chunk.getTileEntities()) {
            if (isConcealable(state.getBlock())) {
                positions.add(key(state.getBlock()));
            }
        }
        if (positions.isEmpty()) {
            blocksByChunk.remove(chunkKey);
        } else {
            blocksByChunk.put(chunkKey, positions);
        }
    }

    private void scheduleBlockRefresh(Block block) {
        BlockKey blockKey = key(block);
        getServer().getScheduler().runTask(this, () -> {
            org.bukkit.World world = Bukkit.getWorld(blockKey.worldId());
            if (world == null || !world.isChunkLoaded(blockKey.x() >> 4, blockKey.z() >> 4)) {
                return;
            }
            Block current = world.getBlockAt(blockKey.x(), blockKey.y(), blockKey.z());
            ChunkKey chunkKey = new ChunkKey(blockKey.worldId(), blockKey.x() >> 4, blockKey.z() >> 4);
            Set<BlockKey> positions = blocksByChunk.computeIfAbsent(chunkKey, ignored -> new HashSet<>());
            if (isConcealable(current)) {
                positions.add(blockKey);
            } else {
                positions.remove(blockKey);
                if (positions.isEmpty()) {
                    blocksByChunk.remove(chunkKey);
                }
            }
        });
    }

    private void refreshPlayers() {
        int viewDistance = getServer().getViewDistance() + 1;
        for (Player player : Bukkit.getOnlinePlayers()) {
            refreshPlayer(player, viewDistance);
        }
    }

    private void refreshPlayer(Player player, int viewDistance) {
        UUID worldId = player.getWorld().getUID();
        int playerChunkX = player.getLocation().getBlockX() >> 4;
        int playerChunkZ = player.getLocation().getBlockZ() >> 4;
        Set<BlockKey> candidates = new HashSet<>();
        Set<BlockKey> stale = new HashSet<>();

        for (int chunkX = playerChunkX - viewDistance; chunkX <= playerChunkX + viewDistance; chunkX++) {
            for (int chunkZ = playerChunkZ - viewDistance; chunkZ <= playerChunkZ + viewDistance; chunkZ++) {
                Set<BlockKey> positions = blocksByChunk.get(new ChunkKey(worldId, chunkX, chunkZ));
                if (positions == null) {
                    continue;
                }
                for (BlockKey position : positions) {
                    Block block = player.getWorld().getBlockAt(position.x(), position.y(), position.z());
                    if (isConcealable(block)) {
                        candidates.add(position);
                    } else {
                        stale.add(position);
                    }
                }
            }
        }

        for (BlockKey position : stale) {
            removeTrackedBlock(position);
        }

        Set<BlockKey> concealed = concealedByPlayer.computeIfAbsent(player.getUniqueId(), ignored -> new HashSet<>());
        Iterator<BlockKey> iterator = concealed.iterator();
        while (iterator.hasNext()) {
            BlockKey position = iterator.next();
            int chunkDistance = Math.max(Math.abs((position.x() >> 4) - playerChunkX),
                    Math.abs((position.z() >> 4) - playerChunkZ));
            if (!position.worldId().equals(worldId) || chunkDistance > viewDistance) {
                iterator.remove();
            } else if (!candidates.contains(position)) {
                player.sendBlockChange(location(position), blockData(position));
                iterator.remove();
            }
        }

        Location playerLocation = player.getLocation();
        for (BlockKey position : candidates) {
            Location blockLocation = location(position).add(0.5, 0.5, 0.5);
            if (playerLocation.distanceSquared(blockLocation) <= HIDE_DISTANCE_SQUARED) {
                if (concealed.remove(position)) {
                    player.sendBlockChange(location(position), blockData(position));
                }
            } else if (concealed.add(position)) {
                player.sendBlockChange(location(position), air);
            }
        }
    }

    private void removeTrackedBlock(BlockKey position) {
        ChunkKey chunkKey = new ChunkKey(position.worldId(), position.x() >> 4, position.z() >> 4);
        Set<BlockKey> positions = blocksByChunk.get(chunkKey);
        if (positions != null) {
            positions.remove(position);
            if (positions.isEmpty()) {
                blocksByChunk.remove(chunkKey);
            }
        }
    }

    private Location location(BlockKey position) {
        return new Location(Bukkit.getWorld(position.worldId()), position.x(), position.y(), position.z());
    }

    private BlockData blockData(BlockKey position) {
        return Bukkit.getWorld(position.worldId()).getBlockAt(position.x(), position.y(), position.z()).getBlockData();
    }

    private BlockKey key(Block block) {
        return new BlockKey(block.getWorld().getUID(), block.getX(), block.getY(), block.getZ());
    }

    private boolean isConcealable(Block block) {
        String type = block.getType().name();