A
📎 1 file 7,646 chars
📄
pasted-code-1787680231259.txt
txt 339 lines
▶
Create a Minecraft Java Edition 1.21.11 Fabric client-only mod named `ServerPluginScanner`.

Author: Shubham Saini

## Main Goal

Build a professional client-side Minecraft Fabric mod that automatically analyzes the server-side plugin information that is legitimately exposed to the Minecraft client after joining a multiplayer server.

The mod must NOT require a server-side plugin for its scanning functionality.

The mod should detect and display any plugin/mod/server information that is actually available through normal Minecraft network communication, server responses, supported APIs, or publicly exposed metadata.

Important security requirement:

The mod must NOT exploit vulnerabilities, bypass permissions, access the remote server filesystem, read the server's `plugins/` directory directly, execute unauthorized commands, or secretly download hidden plugin JAR files.

## Minecraft Version

* Minecraft Java Edition 1.21.11
* Fabric Loader
* Fabric API
* Java 21+

## Mod ID

serverpluginscanner

## Main Features

### 1. Automatic Server Detection

When the player joins a multiplayer server:

* Detect the current server connection.
* Detect the server address when available.
* Detect server software/version information that is legitimately exposed.
* Start a plugin-information scan automatically.

Display:

Server Plugin Scanner
━━━━━━━━━━━━━━━━━━━━
Server: Example Server
Version: 1.21.11
Status: Scanning...

### 2. Plugin Detection

Detect plugin information only from legitimate client-visible sources.

Possible information includes:

* Plugin name
* Plugin version
* Server software
* Server version
* Publicly exposed plugin metadata
* Compatible server information

Do not assume that every server exposes its complete plugin list.

Clearly distinguish between:

[DETECTED]
Information confirmed from the server.

[UNKNOWN]
Information that cannot be determined from the client.

### 3. GUI

Add a keybind:

`Right Shift`

Opening:

SERVER PLUGIN SCANNER

Server:
Example Server

Server Software:
Paper

Detected Components:
━━━━━━━━━━━━━━━━━━━━

EssentialsX
Version: 2.x
Status: Detected

WorldEdit
Version: Unknown
Status: Detected

LuckPerms
Version: Unknown
Status: Detected

━━━━━━━━━━━━━━━━━━━━

[Refresh Scan]
[Export Report]
[Close]

### 4. `/serverplugins` Command

Add a client-side command:

`/serverplugins`

The command opens the scanner GUI.

Additional commands:

`/serverplugins scan`

`/serverplugins info`

`/serverplugins export`

`/serverplugins clear`

### 5. Scan Report

Allow the user to export a report containing only information legitimately detected by the client.

Example:

server-report/
server-info.json
detected-components.json

The JSON should contain:

* Server software
* Minecraft version
* Detected plugin/component names
* Detected versions
* Detection source
* Scan timestamp

### 6. Confidence System

Every detected component should have a confidence level:

CONFIRMED
The information was directly exposed by the server.

LIKELY
The information was inferred from legitimate client-visible behavior.

UNKNOWN
The client does not have enough information to determine it.

Never present guesses as confirmed plugin information.

### 7. No False Detection

Do NOT simply maintain a huge database and claim that a plugin exists because a server behaves similarly.

Only report:

* confirmed information,
* clearly marked inference,
* or unknown.

### 8. Optional Public Metadata Lookup

If the user enables it, the mod may use publicly available internet information to identify known server software or publicly documented plugin metadata.

This feature must be:

* Disabled by default.
* Clearly shown to the user.
* Limited to public information.
* Never used to access private server files.

### 9. Local History

Store previous scans locally:

config/server-history.json

For each server:

* Server identifier
* Scan date
* Detected components
* Version information
* Scan results

Provide:

[Scan History]

inside the GUI.

### 10. Privacy

Do not upload:

* Minecraft account credentials
* Session tokens
* Passwords
* Private server files
* Chat messages
* Personal files

Do not attempt to bypass authentication.

### 11. Performance

The mod must:

* Run scanning asynchronously.
* Never freeze the Minecraft client.
* Avoid excessive network requests.
* Cache results.
* Prevent repeated scans from spamming the server.

### 12. User Interface

Use a modern dark Minecraft-style interface.

Main screen:

SERVER PLUGIN SCANNER

┌─────────────────────────────────┐
│ Server: Example SMP             │
│ Version: 1.21.11                │
│ Software: Paper                  │
├─────────────────────────────────┤
│ Detected Components              │
│                                  │
│ ✓ Component A     CONFIRMED      │
│ ✓ Component B     CONFIRMED      │
│ ? Component C     UNKNOWN        │
│                                  │
├─────────────────────────────────┤
│ [REFRESH] [EXPORT] [HISTORY]    │
└─────────────────────────────────┘

### 13. Architecture

Use a clean modular structure:

src/main/java/
ServerPluginScanner.java
ScannerManager.java
ServerConnectionManager.java
DetectionManager.java
DetectionResult.java
DetectionSource.java
ScanHistory.java
ReportExporter.java
ConfigManager.java
NetworkManager.java
gui/
ScannerScreen.java
HistoryScreen.java
ComponentScreen.java
commands/
ServerPluginsCommand.java
utils/
JsonUtils.java
HashUtils.java
LoggerUtils.java

src/main/resources/
fabric.mod.json
assets/
serverpluginscanner/

### 14. Important Technical Constraint

The implementation must recognize an important limitation:

A client-side Minecraft mod cannot normally read arbitrary files from the remote Minecraft server.

Therefore:

DO NOT create fake functionality that claims to download arbitrary server plugin JARs.

DO NOT implement exploits or vulnerability-based extraction.

DO NOT attempt path traversal against the server.

DO NOT attempt RCE or command injection.

DO NOT attempt to bypass server permissions.

DO NOT attempt to access `/plugins/`, `/server/`, or other remote filesystem paths.

If the server does not expose plugin information, display:

"Plugin information is not publicly exposed by this server."

### 15. Authorized Backup Mode

Add an optional mode for servers where the user has explicit authorization.

If the user owns/administers the server, the project may provide a separate companion server-side component that exposes a secure authenticated backup API.

The client mod can then:

* Authenticate the administrator.
* Request a plugin backup.
* Download selected authorized plugin JARs.
* Verify SHA-256.
* Save them locally.

This mode must require explicit server-side authorization and must never work as an unauthorized extraction mechanism.

### 16. Final Deliverables

Generate the complete source code for the Fabric 1.21.11 client mod.

Include:

* Complete Gradle project.
* `fabric.mod.json`.
* Fabric API dependencies.
* Java 21 configuration.
* Client commands.
* GUI.
* Scanner system.
* Detection framework.
* JSON export.
* Local history.
* Configuration system.
* README.md.
* Build instructions.
* Installation instructions.

The resulting project must compile successfully and should be structured as a professional open-source Minecraft utility mod.
Kodari AI
KodariAug 25 at 5:51 pm 11
ServerPluginScanner
Client-side Fabric mod for Minecraft 1.21.11 that automatically detects and displays server plugin information legitimately exposed to the client after joining a multiplayer server. Features automatic server detection, plugin scanning with confidence levels (CONFIRMED/LIKELY/UNKNOWN), a modern dark GUI accessible via Right Shift keybind or /serverplugins command, JSON report export, local scan history, and optional public metadata lookup (disabled by default). Scans run asynchronously without freezing the client, respects privacy, and clearly indicates when plugin information is not publicly exposed. Includes an authorized backup mode for server administrators with explicit authentication.
  1. Create the Fabric 1.21.11 client project and metadata.

  2. Implement safe client-visible scanning, caching, history, and JSON export.

  3. Add keybind, client commands, and dark scanner/history GUI.

  4. Add resources and complete build, installation, and privacy documentation.

  1. Created the complete Fabric 1.21.11 client-only ServerPluginScanner Gradle project.

  2. Implemented asynchronous, rate-limited, privacy-safe scanning with explicit unknown results when plugin data is not publicly exposed.

  3. Added Right Shift keybind, /serverplugins client commands, scanner/history/component GUIs, local history, and JSON report export.

  4. Added build metadata, Fabric configuration, language resources, and README with installation, build, privacy, and authorized-backup constraints.

A

The compilation failed with this error:

code
Compilation failed with 10 error(s):

ERROR in src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ScannerScreen.java at line 40: cannot find symbol
        context.drawBorder(left, top, 360, 220, BORDER_COLOR);
               ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/HistoryScreen.java at line 31: cannot find symbol
        context.drawBorder(left, 30, 360, height - 80, 0xFF4A5568);
               ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ComponentScreen.java at line 31: cannot find symbol
        context.drawBorder(left, top, 300, 150, 0xFF4A5568);
               ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java at line 19: cannot find symbol
        String name = info.name == null || info.name.getString().isBlank() ? address : info.name.getString();
                                                    ^
  symbol: method getString()
  location: variable name of type String

ERROR in src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java at line 19: cannot find symbol
        String name = info.name == null || info.name.getString().isBlank() ? address : info.name.getString();
                                                                                                ^
  symbol: method getString()
  location: variable name of type String

ERROR in   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ScannerScreen.java at line 40: cannot find symbol
          context.drawBorder(left, top, 360, 220, BORDER_COLOR);
                 ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/HistoryScreen.java at line 31: cannot find symbol
          context.drawBorder(left, 30, 360, height - 80, 0xFF4A5568);
                 ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ComponentScreen.java at line 31: cannot find symbol
          context.drawBorder(left, top, 300, 150, 0xFF4A5568);
                 ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java at line 19: cannot find symbol
          String name = info.name == null || info.name.getString().isBlank() ? address : info.name.getString();
                                                      ^
  symbol: method getString()
  location: variable name of type String

ERROR in   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java at line 19: cannot find symbol
          String name = info.name == null || info.name.getString().isBlank() ? address : info.name.getString();
                                                                                                  ^
  symbol: method getString()
  location: variable name of type String


=== COMPILATION ERROR ANALYSIS ===

MISSING METHODS:
  - drawBorder(int,int,int,int,int)
  - getString()
ACTION: Check method names and signatures

FILES TO INVESTIGATE:
  - src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ScannerScreen.java
  - src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/HistoryScreen.java
  - src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ComponentScreen.java
  - src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java
  -   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ScannerScreen.java
  -   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/HistoryScreen.java
  -   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ComponentScreen.java
  -   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java

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

Kodari AI
KodariAug 25 at 5:52 pm 3
  • Replace unsupported DrawContext.drawBorder calls with compatible line primitives.

  • Treat ServerInfo.name as the String it is in this mapping set.

  • Preserve the existing layout and behavior without changing scan logic.

Fixed the 10 compilation errors.

  • Replaced unavailable DrawContext.drawBorder(...) calls with compatible horizontal and vertical line drawing in all three screens.

  • Corrected ServerInfo.name handling: it is already a String, so .getString() is no longer called.

  • Updated artifact source files under the correct Fabric client source set: src/client/java/....

A

The compilation failed with this error:

code
Compilation failed with 10 error(s):

ERROR in src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ScannerScreen.java at line 40: cannot find symbol
        context.drawBorder(left, top, 360, 220, BORDER_COLOR);
               ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/HistoryScreen.java at line 31: cannot find symbol
        context.drawBorder(left, 30, 360, height - 80, 0xFF4A5568);
               ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ComponentScreen.java at line 31: cannot find symbol
        context.drawBorder(left, top, 300, 150, 0xFF4A5568);
               ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java at line 19: cannot find symbol
        String name = info.name == null || info.name.getString().isBlank() ? address : info.name.getString();
                                                    ^
  symbol: method getString()
  location: variable name of type String

ERROR in src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java at line 19: cannot find symbol
        String name = info.name == null || info.name.getString().isBlank() ? address : info.name.getString();
                                                                                                ^
  symbol: method getString()
  location: variable name of type String

ERROR in   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ScannerScreen.java at line 40: cannot find symbol
          context.drawBorder(left, top, 360, 220, BORDER_COLOR);
                 ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/HistoryScreen.java at line 31: cannot find symbol
          context.drawBorder(left, 30, 360, height - 80, 0xFF4A5568);
                 ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ComponentScreen.java at line 31: cannot find symbol
          context.drawBorder(left, top, 300, 150, 0xFF4A5568);
                 ^
  symbol: method drawBorder(int,int,int,int,int)
  location: variable context of type DrawContext

ERROR in   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java at line 19: cannot find symbol
          String name = info.name == null || info.name.getString().isBlank() ? address : info.name.getString();
                                                      ^
  symbol: method getString()
  location: variable name of type String

ERROR in   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java at line 19: cannot find symbol
          String name = info.name == null || info.name.getString().isBlank() ? address : info.name.getString();
                                                                                                  ^
  symbol: method getString()
  location: variable name of type String


=== COMPILATION ERROR ANALYSIS ===

MISSING METHODS:
  - drawBorder(int,int,int,int,int)
  - getString()
ACTION: Check method names and signatures

FILES TO INVESTIGATE:
  - src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ScannerScreen.java
  - src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/HistoryScreen.java
  - src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ComponentScreen.java
  - src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java
  -   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ScannerScreen.java
  -   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/HistoryScreen.java
  -   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/gui/ComponentScreen.java
  -   src/main/java/client/java/com/shubhamsaini/serverpluginscanner/scan/ServerConnectionManager.java

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

Kodari AI
KodariAug 25 at 5:54 pm 3

The project’s active source files are already corrected under the proper Fabric client source set, src/client/java/...:

  • drawBorder(...) has been replaced with drawHorizontalLine(...) and drawVerticalLine(...).

  • ServerInfo.name is used directly as a String, without .getString().

The reported errors reference the obsolete src/main/java/client/java/... layout, which is not present in the artifact. Rebuild/download the updated artifact so the compiler uses src/client/java/... rather than the stale source tree.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
README.md
settings.gradle
Code
24 785
src/client/java/com/shubhamsaini/serverpluginscanner/ServerPluginScanner.java
package com.shubhamsaini.serverpluginscanner;

import com.shubhamsaini.serverpluginscanner.command.ServerPluginsCommand;
import com.shubhamsaini.serverpluginscanner.config.ConfigManager;
import com.shubhamsaini.serverpluginscanner.gui.ScannerScreen;
import com.shubhamsaini.serverpluginscanner.scan.ScannerManager;
import com.shubhamsaini.serverpluginscanner.util.LoggerUtils;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

public final class ServerPluginScanner implements ClientModInitializer {
    public static final String MOD_ID = "serverpluginscanner";
    private static final KeyBinding.Category KEY_CATEGORY = KeyBinding.Category.create(Identifier.of(MOD_ID, "general"));
    private static KeyBinding openKey;

    @Override
    public void onInitializeClient() {
        ConfigManager.load();
        openKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.serverpluginscanner.open", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_RIGHT_SHIFT, KEY_CATEGORY));

        ServerPluginsCommand.register();
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (openKey.wasPressed()) {
                client.setScreen(new ScannerScreen());
            }
        });
        ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> ScannerManager.scanCurrentServer(false));
        ClientPlayConnectionEvents.DISCONNECT.register((handler, client) -> ScannerManager.clearActiveScan());
        LoggerUtils.info("Initialized safe client-visible server scanner.");
    }
}