📄
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.
Create the Fabric 1.21.11 client project and metadata.
Implement safe client-visible scanning, caching, history, and JSON export.
Add keybind, client commands, and dark scanner/history GUI.
Add resources and complete build, installation, and privacy documentation.
Created the complete Fabric 1.21.11 client-only
ServerPluginScannerGradle project.Implemented asynchronous, rate-limited, privacy-safe scanning with explicit unknown results when plugin data is not publicly exposed.
Added Right Shift keybind,
/serverpluginsclient commands, scanner/history/component GUIs, local history, and JSON report export.Added build metadata, Fabric configuration, language resources, and README with installation, build, privacy, and authorized-backup constraints.
The compilation failed with this error:
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.
Replace unsupported
DrawContext.drawBordercalls with compatible line primitives.Treat
ServerInfo.nameas theStringit 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.namehandling: it is already aString, so.getString()is no longer called.Updated artifact source files under the correct Fabric client source set:
src/client/java/....
The compilation failed with this error:
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.
The project’s active source files are already corrected under the proper Fabric client source set, src/client/java/...:
drawBorder(...)has been replaced withdrawHorizontalLine(...)anddrawVerticalLine(...).ServerInfo.nameis used directly as aString, 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.
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.");
}
}