📄
pasted-code-1787684407145.txt
txt
753 lines
▶
Create a complete, production-ready Minecraft Java Edition 1.21.11 Plugin Extractor and Backup system.
The project must be designed ONLY for Minecraft servers where the user has explicit authorization to access and back up server plugin files.
Do not implement exploits, vulnerabilities, permission bypasses, path traversal, RCE, credential theft, hidden filesystem access, or any mechanism intended to extract plugins from an unauthorized third-party server.
# PROJECT NAME
PluginExtractor
Author:
Shubham Saini
Minecraft:
Java Edition 1.21.11
Client:
Fabric 1.21.11
Server:
Paper 1.21.11
Java:
21+
# PROJECT OBJECTIVE
Create a professional Minecraft plugin extraction/backup system.
The user should be able to join an authorized Minecraft server and open the Plugin Extractor GUI.
The GUI should show the plugins that the authorized server-side component has made available for backup.
The user can:
* View installed plugins
* View plugin names
* View plugin versions
* View plugin JAR filenames
* Select individual plugins
* Select multiple plugins
* Extract selected plugins
* Extract all authorized plugins
* View extraction progress
* Cancel an extraction
* Verify downloaded files
* Open the local extraction folder
* View extraction history
The system must preserve the original plugin JAR bytes exactly.
# IMPORTANT ARCHITECTURE
The project must contain TWO components.
## COMPONENT 1 — CLIENT MOD
Fabric 1.21.11 client mod.
Name:
PluginExtractorClient
Responsibilities:
* GUI
* Server connection detection
* Authentication
* Plugin list display
* Plugin selection
* Extraction requests
* Chunked file downloads
* SHA-256 verification
* Local file storage
* Extraction history
* Progress display
* Error handling
The client must NEVER attempt to directly access the remote server filesystem.
## COMPONENT 2 — SERVER PLUGIN
Paper 1.21.11 plugin.
Name:
PluginExtractorBridge
Responsibilities:
* Scan the server's plugin directory
* Detect installed plugin JAR files
* Verify administrator authorization
* Expose only explicitly authorized plugin files
* Authenticate extraction requests
* Read JAR files
* Send files in chunks
* Calculate SHA-256
* Enforce file-size limits
* Enforce permissions
* Log every extraction
* Prevent arbitrary filesystem access
# SERVER-SIDE DIRECTORY
The bridge may access ONLY:
plugins/
and its own controlled backup/extraction directories.
It must NOT allow arbitrary filesystem paths.
Never accept a raw filesystem path from the client.
Instead use an internal plugin ID generated by the server.
Example:
Plugin ID:
p_001
Internal mapping:
p_001 → plugins/EssentialsX.jar
The client can request:
EXTRACT_PLUGIN p_001
but can never request:
C:/server/plugins/EssentialsX.jar
or:
../../server.properties
# AUTHORIZATION
Create permission:
pluginextractor.use
Create permission:
pluginextractor.list
Create permission:
pluginextractor.extract
Create permission:
pluginextractor.extractall
Create permission:
pluginextractor.admin
Only users with the appropriate permissions can access extraction functionality.
The server must be authoritative.
Never trust permission information supplied by the client.
# COMMANDS
Server-side commands:
/pluginextractor
/pluginextractor list
/pluginextractor status
/pluginextractor reload
/pluginextractor allow
/pluginextractor deny
Client-side command:
/pluginextractor
Opening the command should open the GUI.
# SERVER PLUGIN SCANNER
When an authorized administrator connects:
Scan:
plugins/
Detect:
* JAR files
* Plugin name
* Plugin version
* Plugin description
* Enabled/disabled status
* JAR filename
* File size
Use Paper/Bukkit plugin metadata where possible.
Do not assume filename equals plugin name.
Example:
Detected Plugins
1. EssentialsX
Version: 2.x
File: EssentialsX.jar
Size: 3.2 MB
Status: Enabled
2. WorldEdit
Version: 7.x
File: worldedit-bukkit.jar
Size: 8.7 MB
Status: Enabled
# CLIENT GUI
Create a modern dark Minecraft-style GUI.
Main screen:
PLUGIN EXTRACTOR
Server:
Example SMP
Connection:
AUTHORIZED
Detected Plugins:
12
---
[✓] EssentialsX
Version: 2.x
Size: 3.2 MB
[ ] WorldEdit
Version: 7.x
Size: 8.7 MB
[ ] LuckPerms
Version: 5.x
Size: 4.1 MB
---
[SELECT ALL]
[EXTRACT SELECTED]
[EXTRACT ALL]
[REFRESH]
[HISTORY]
# PLUGIN DETAILS SCREEN
When a plugin is clicked:
Plugin Details
Name:
EssentialsX
Version:
2.x
Filename:
EssentialsX.jar
Size:
3.2 MB
Status:
Enabled
SHA-256:
xxxxxxxxxxxxxxxx
[EXTRACT]
[BACK]
# EXTRACTION PROCESS
When the user selects a plugin:
1. Client sends plugin ID.
2. Server verifies player authorization.
3. Server verifies plugin ID exists.
4. Server resolves plugin ID internally.
5. Server verifies file is inside the permitted plugins directory.
6. Server checks file size.
7. Server calculates SHA-256.
8. Server begins transfer.
9. File is divided into fixed-size chunks.
10. Chunks are transferred sequentially.
11. Client reconstructs the JAR.
12. Client calculates SHA-256.
13. Client compares hashes.
14. If hashes match, extraction is successful.
15. If hashes do not match, delete the incomplete file and report failure.
# CHUNKED TRANSFER
Do not attempt to send an entire large JAR in one packet.
Use configurable chunks.
Default:
64 KB per chunk
Each transfer packet should contain:
* Transfer ID
* Plugin ID
* Chunk index
* Total chunks
* Chunk size
* SHA-256 of complete file
* Binary data
Support:
* Progress percentage
* Transfer speed
* ETA
* Cancellation
* Retry of failed chunks
Example:
Extracting EssentialsX.jar
████████████████░░░░ 82%
82% — 2.6 MB / 3.2 MB
Speed: 4.8 MB/s
[ CANCEL ]
# FILE STORAGE
Save extracted files locally in:
PluginExtractor/
extracted-plugins/
ExampleServer/
2026-08-25/
EssentialsX.jar
WorldEdit.jar
extraction-info.json
The exact path should be configurable.
# EXTRACTION INFO
Generate:
extraction-info.json
Example fields:
{
"server": "Example SMP",
"timestamp": "...",
"minecraft_version": "1.21.11",
"plugin": "EssentialsX",
"version": "...",
"filename": "EssentialsX.jar",
"size": 1234567,
"sha256": "...",
"verified": true
}
# EXTRACT ALL
When the administrator clicks:
EXTRACT ALL
show confirmation:
You are about to back up 12 plugin files.
Total size:
48.6 MB
Continue?
[YES]
[CANCEL]
The server must verify authorization again before starting.
Process files sequentially or with a small configurable concurrency limit.
Never overload the server.
# EXTRACTION HISTORY
Create a history screen.
Example:
Extraction History
25 Aug 2026
✓ EssentialsX.jar
✓ WorldEdit.jar
✓ LuckPerms.jar
24 Aug 2026
✓ MyPlugin.jar
Each record should include:
* Server
* Plugin
* Timestamp
* File size
* SHA-256
* Verification result
# SECURITY
Implement strong security.
The client must NEVER be able to:
* Specify arbitrary server paths
* Read server.properties
* Read world files
* Read player data
* Read logs unless explicitly authorized as a separate feature
* Execute server commands
* Read arbitrary files
* Modify server files
* Delete server files
* Browse the server filesystem
The bridge must expose ONLY plugin JAR files explicitly permitted by its configuration.
# ALLOWED PLUGINS CONFIGURATION
Create:
config.yml
Example:
enabled: true
allow-extraction: true
max-file-size-mb: 100
chunk-size-kb: 64
allow-extract-all: true
authorized-players: []
allowed-plugins: []
log-extractions: true
If:
allowed-plugins:
is not empty, only those plugin IDs/names can be extracted.
# ADMIN GUI
Add an optional server-side administrative interface or commands allowing administrators to configure:
* Authorized players
* Allowed plugins
* Maximum file size
* Extraction enabled/disabled
* Extract-all enabled/disabled
* Transfer limits
# RATE LIMITING
Implement:
* Maximum simultaneous transfers
* Maximum requests per minute
* Maximum total transfer size
* Cooldown between extraction requests
Default values should be configurable.
# LOGGING
Every extraction must be logged.
Example:
[PluginExtractor]
Player: Shubham
Plugin: EssentialsX
File: EssentialsX.jar
Size: 3.2 MB
SHA-256: ...
Status: SUCCESS
For failures:
Status: FAILED
Reason: Permission denied
# NETWORK PROTOCOL
Create a clean versioned protocol.
Example:
Protocol:
PLUGIN_EXTRACTOR_V1
Messages:
HELLO
AUTH_REQUEST
AUTH_RESPONSE
PLUGIN_LIST_REQUEST
PLUGIN_LIST_RESPONSE
EXTRACT_REQUEST
EXTRACT_ACCEPT
FILE_CHUNK
FILE_COMPLETE
TRANSFER_CANCEL
TRANSFER_ERROR
PING
Every request should include a request/transfer ID.
Reject malformed packets.
# FILE VALIDATION
Before exposing a JAR:
* Verify file exists
* Verify it is a regular file
* Verify `.jar` extension
* Verify canonical path remains inside allowed plugin directory
* Verify maximum size
* Verify readable
* Calculate SHA-256
Never follow unsafe symbolic links outside the permitted directory.
# ERROR HANDLING
Handle:
* Permission denied
* Plugin not found
* Plugin disabled
* File missing
* File changed during transfer
* File too large
* Disk full
* Connection lost
* Transfer timeout
* Hash mismatch
* Cancelled transfer
* Invalid plugin ID
* Unauthorized request
* Server extraction disabled
Show clear messages.
Example:
Extraction Failed
Plugin:
EssentialsX
Reason:
The server administrator has not authorized extraction of this plugin.
[OK]
# CONNECTION HANDLING
When leaving the server:
* Cancel active transfers
* Close network state
* Clear temporary buffers
* Do not retain server credentials
* Mark interrupted transfers as incomplete
When reconnecting:
* Start a new authenticated session.
# TEMPORARY FILES
Never directly write incomplete data to the final JAR filename.
Use:
EssentialsX.jar.part
After successful SHA-256 verification:
rename:
EssentialsX.jar.part
to:
EssentialsX.jar
Delete incomplete files after failed transfers.
# CODE QUALITY
Use clean OOP architecture.
Separate:
* Network
* Authentication
* GUI
* File transfer
* Security
* Configuration
* History
* Logging
* Server scanning
Avoid blocking the Minecraft render thread.
Use asynchronous operations for:
* File reading
* Hashing
* File writing
* Network transfer
# PROJECT STRUCTURE
Create:
PluginExtractor/
│
├── client/
│ ├── build.gradle
│ ├── gradle.properties
│ └── src/main/
│ ├── java/
│ │ └── com/shubham/pluginextractor/
│ │ ├── PluginExtractorClient.java
│ │ ├── network/
│ │ ├── gui/
│ │ ├── transfer/
│ │ ├── history/
│ │ ├── commands/
│ │ ├── config/
│ │ └── util/
│ └── resources/
│ └── fabric.mod.json
│
├── server/
│ ├── build.gradle
│ ├── gradle.properties
│ └── src/main/
│ ├── java/
│ │ └── com/shubham/pluginextractor/
│ │ ├── PluginExtractorBridge.java
│ │ ├── scanner/
│ │ ├── network/
│ │ ├── security/
│ │ ├── transfer/
│ │ ├── commands/
│ │ ├── config/
│ │ └── util/
│ └── resources/
│ ├── plugin.yml
│ └── config.yml
│
├── README.md
└── LICENSE
# BUILD REQUIREMENTS
Use:
* Java 21
* Fabric Loader compatible with Minecraft 1.21.11
* Fabric API compatible with Minecraft 1.21.11
* Paper API compatible with Minecraft 1.21.11
* Gradle
Pin compatible dependency versions rather than using wildcard versions.
# README
Generate a complete README explaining:
1. What the project does.
2. Why the server bridge is required.
3. Installation.
4. Client setup.
5. Server setup.
6. Permissions.
7. Configuration.
8. How to authorize players.
9. How to extract a plugin.
10. How to extract all authorized plugins.
11. Where extracted JARs are saved.
12. Security model.
13. Troubleshooting.
14. Development/build instructions.
# FINAL REQUIREMENT
Generate the complete source code for BOTH components.
The finished system must compile successfully for Minecraft 1.21.11.
The client must never claim that it can magically access a remote server's hidden filesystem.
Actual plugin JAR extraction must occur only through the explicitly installed and authorized Paper server bridge.
The final result should feel like a polished professional plugin-backup/extraction utility rather than a proof-of-concept.
Create the Fabric client with the authenticated GUI, binary protocol, resumable chunk receiver, SHA-256 verification, local storage, and history.
Create the Paper bridge with permission enforcement, allowlisted plugin scanning, secure transfer/rate limits, commands, and audit logging.
Add pinned Gradle builds, configuration, documentation, and license.
Fabric client: added the 1.21.11 client mod with
/pluginextractor, dark GUI, selection/extract controls, chunked downloads,.partfiles, SHA-256 verification, local metadata, and extraction history.Paper bridge: added server-authoritative authentication, permissions, UUID authorization, opaque plugin IDs, allowlists, canonical
plugins/containment checks, symlink rejection, size/rate/concurrency limits, cancellation, hashing, commands, and extraction audit logs.Build and documentation: added a Java 21 multi-project Gradle build, pinned Fabric/Paper dependencies, bridge configuration, plugin manifest, MIT license,
.gitignore, and a complete security-focused README.
package com.shubham.pluginextractor.client;
import com.shubham.pluginextractor.client.network.BridgeClient;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
public final class PluginExtractorClientEntrypoint implements ClientModInitializer {
@Override
public void onInitializeClient() {
BridgeClient.initialize();
ClientPlayNetworking.registerGlobalReceiver(PluginExtractorClient.PAYLOAD_ID, (payload, context) -> BridgeClient.receive(payload.data()));
ClientCommands.register();
}
}