X

make me a plugin that can cause a connection protocoll error when i click the INVENTORY GUI make it only activate and open the INVENTORY GUI when i open my inventory or open any INVENTORY GUI

Kodari AI
KodariApr 10 at 11:50 pm 7,738 (v2)

I’ll create a plugin that intercepts inventory opens and displays a GUI that causes protocol errors when clicked.

ProtocolErrorGUI
A plugin that intercepts all inventory open events and replaces them with a custom GUI. When players click items in this GUI, it triggers connection protocol errors by sending malformed packets or forcefully disconnecting the player. Useful for testing client stability, anti-cheat systems, or creating unique punishment mechanics. Features configurable error messages and toggle commands.

Plugin created! This intercepts ALL inventory opens and shows a custom GUI with 4 buttons that trigger different protocol errors:

Features:

  • Force Disconnect - Kicks with malformed Unicode characters

  • Invalid Packet - Teleports to NaN coordinates causing protocol errors

  • Connection Overflow - Spams 1000 messages then kicks

  • Critical Error - Combines multiple error methods

Commands:

  • /protocolgui or /pgui - Toggle on/off

  • /protocolgui bypass permission exempts players

When enabled, opening ANY inventory (player inventory, chests, furnaces, etc.) will show the error GUI instead. Click any colored button to trigger that specific protocol error method.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
11 489
src/main/java/com/protocolerrorgui/ProtocolErrorGUI.java
package com.protocolerrorgui;

import com.protocolerrorgui.commands.ToggleCommand;
import com.protocolerrorgui.inventory.gui.GUIListener;
import com.protocolerrorgui.inventory.gui.GUIManager;
import com.protocolerrorgui.listeners.InventoryOpenListener;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class ProtocolErrorGUI extends JavaPlugin {
    
    private GUIManager guiManager;
    private boolean featureEnabled = true;
    
    @Override
    public void onEnable() {
        this.guiManager = new GUIManager();
        
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new InventoryOpenListener(this), this);
        
        this.getCommand("protocolgui").setExecutor(new ToggleCommand(this));
        
        getLogger().info("ProtocolErrorGUI has been enabled!");
        getLogger().warning("This plugin will intercept ALL inventory opens!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("ProtocolErrorGUI has been disabled!");
    }

    public void setFeatureEnabled(boolean enabled) {
        this.featureEnabled = enabled;
    }

    public boolean isFeatureEnabled() {
        return this.featureEnabled;
    }
}