miss_kavitaa
📎 1 file 2,768 chars
📄
pasted-code-1772041974412.txt
txt 23 lines
▶
Create a high-performance Minecraft Paper/Spigot plugin compatible with modern versions (1.21+).
Plugin name: "PMC-GUARD"
Plugin Author: "LUCIFER_XD"
Plugin version: "1.0"
The plugin must instantly monitor all player inventories, ender chests, and all container items including nested shulker boxes. As soon as any player obtains or holds an item with enchantment level 11 or higher, the plugin must immediately add the following lore line to that exact item without removing it: "&cILLEGAL ITEM: &4{PLAYER}". The {PLAYER} value must be the original creator of the item (the first player who created the item or loaded it from saved hotbar; if the original source cannot be determined, fallback to the current holder). This detection and lore application must happen instantly on item pickup, inventory move, crafting, container open, shulker interaction, and any other possible method.
make sure if a item got his lore then don't change. 

 Note: Do not load 10 or lover then 10 level enchants. 

Whenever such an illegal enchanted item is detected, the console must automatically execute the command: "/ban {player} ILLEGAL STUFF" where {player} is the current holder of the illegal item. The item itself must remain in the player inventory and must not be cleared. Full support for shulker boxes is required, including nested shulkers.
if the item is in a shulker then give lore to that shulker. and execute that command. 
 
The plugin must also monitor potion effects. If any player receives a potion effect that exceeds vanilla maximum levels or is permanent/invalid, the plugin must instantly clear that illegal potion effect from the player.
 
If any player possesses 64 Enchanted Golden Apples or 64 Netherite Blocks in a single stack anywhere in their inventory, ender chest, or inside shulker boxes (including nested), that stack must be automatically cleared instantly. add Shulker Box support. if that items is in shulker then clear the whole shulket box. 
 
If a Dragon Egg enters any player inventory by any method, the plugin must instantly ban the player with reason "ILLEGAL DREGON EGG". The Dragon Egg item must NOT be removed. Instead, the plugin must add lore to that egg: "ILLEGAL &7DREGON EGG: &4{player}" where {player} is the holder.
 
All detections, bans, clears, and illegal findings must be logged into persistent log files with timestamps and player names. Additionally, whenever a player in creative mode places a shulker box or chest in the world, the plugin must log the exact world coordinates (x, y, z), world name, and player name into a separate dedicated log file.

Don't add any OP BYPASS. 
 
The plugin must be optimized for performance, avoid heavy lag, use proper event handling, and ensure instant detection in all edge cases.
Kodari AI
KodariFeb 25 at 5:54 pm 15,453 (v2)

I’ll create a comprehensive anti-cheat monitoring plugin for illegal items, enchantments, and potion effects.

PMCGuard
High-performance anti-cheat plugin that monitors player inventories, ender chests, and nested shulker boxes for illegal enchantments (level 11+), oversized stacks, dragon eggs, and invalid potion effects. Automatically marks illegal items with tracking lore, executes ban commands, and maintains detailed logs of all violations and creative mode container placements. Optimized for 1.21+ with instant detection across all edge cases.

Plugin created with the following features:

  • Instant detection of illegal enchantments (level 11+) across all inventories, ender chests, and nested shulker boxes

  • Automatic lore tagging with original creator tracking using PersistentDataContainer

  • Auto-ban execution for illegal items without removing them

  • Shulker box recursive scanning with lore application to parent shulker when illegal items detected

  • Illegal potion effect detection and removal (exceeds vanilla limits or permanent)

  • Stack size monitoring (64 Enchanted Golden Apples/Netherite Blocks) with shulker clearing

  • Dragon egg detection with special ban and lore marking

  • Comprehensive logging system with timestamps for all violations

  • Creative mode container placement tracking with coordinates

  • Performance-optimized with async logging and efficient event handling

miss_kavitaa

add a option in confing.yml to bypass OP

Kodari AI
KodariFeb 26 at 7:58 am 100 (v2)

The generation was stopped before any content could be produced.

miss_kavitaa

add a option in confing.yml to bypass OP. also add a option bypass permission for luckperms pmcguard.bypass, Don't Support to OP by default

Kodari AI
KodariFeb 26 at 8:01 am 5,320 (v2)

I’ll add bypass options for OP players and a permission node for LuckPerms integration.

Added bypass system with config option for OP players (disabled by default) and pmcguard.bypass permission for LuckPerms integration.

miss_kavitaa

upgrade version to 1.2

Kodari AI
KodariFeb 26 at 8:02 am 4,263 (v2)

I’ll read the files that contain version information and update them to 1.2.

  • Updating version in plugin.yml and build.gradle to 1.2

Version updated to 1.2 in both plugin.yml and build.gradle.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
11 640
src/main/java/com/lucifer/pmcguard/PMCGuard.java
package com.lucifer.pmcguard;

import com.lucifer.pmcguard.listener.BlockListener;
import com.lucifer.pmcguard.listener.InventoryListener;
import com.lucifer.pmcguard.listener.PotionListener;
import com.lucifer.pmcguard.manager.ItemTracker;
import com.lucifer.pmcguard.manager.LogManager;
import com.lucifer.pmcguard.manager.ScanManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class PMCGuard extends JavaPlugin {
    private LogManager logManager;
    private ItemTracker itemTracker;
    private ScanManager scanManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.logManager = new LogManager(this);
        this.itemTracker = new ItemTracker(this);
        this.scanManager = new ScanManager(this);

        Bukkit.getPluginManager().registerEvents(new InventoryListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PotionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new BlockListener(this), this);

        getLogger().info("PMC-GUARD has been enabled!");
    }

    public boolean hasBypass(Player player) {
        if (player.hasPermission("pmcguard.bypass")) {
            return true;
        }
        if (getConfig().getBoolean("bypass.allow-op", false) && player.isOp()) {
            return true;
        }
        return false;
    }

    @Override
    public void onDisable() {
        getLogger().info("PMC-GUARD has been disabled!");
    }
}