UNIVERSAL PERFORMANCE ENGINE (UPE)
Complete Minecraft Paper Optimization Plugin — 12 GB RAM Edition
PROJECT ROLE
Act as a senior Minecraft Paper plugin developer, Java performance engineer, JVM tuning specialist, and Minecraft server administrator.
Design and implement a production-quality Minecraft Java Edition plugin named Universal Performance Engine (UPE).
The plugin's purpose is to improve server performance, reduce avoidable lag, stabilize TPS, identify bottlenecks, and support smooth gameplay for players using low-end, mid-range, and high-end devices.
The target environment is a Paper server with 12 GB of allocated server RAM.
Do not create a plugin that merely displays statistics or executes generic cleanup commands. Build a genuine optimization and diagnostic system with real functionality, low overhead, safe automatic adjustments, and measurable results.
Do not promise zero lag, guaranteed FPS increases, or unlimited player capacity. Every performance claim must be supported by testing.
1. TARGET ENVIRONMENT AND BUILD REQUIREMENTS
Before writing code, establish the exact server environment.
Game: Minecraft Java Edition.
Server implementation: Paper.
Server memory allocation: 12 GB, subject to host and JVM configuration.
Language: Java.
Build system: Gradle Kotlin DSL or Maven.
Plugin API: The exact Paper API matching the chosen server version.
Runtime: The Java version officially required by the selected Paper release.
Plugin name: UniversalPerformanceEngine.
Plugin identifier: UPE.
Main package: com.upe.performance.
Main class: com.upe.performance.UniversalPerformanceEngine.
Use stable, supported APIs wherever possible. Pin the Paper API, Java toolchain, and build dependencies to explicit compatible versions.
Do not compile against a newer API and assume it will work on an older server.
Do not claim support for Spigot, Folia, Purpur, or other forks unless each target has been tested separately.
Prefer conventional plugin.yml registration for a broadly compatible Paper plugin unless the project deliberately targets a specific Paper version and has a documented reason to use newer experimental plugin mechanisms.
The finished build must produce:
build/libs/UniversalPerformanceEngine.jar
The JAR must not bundle Paper API classes into the plugin.
Required development process
Verify the target server version.
Design the module architecture.
Implement the real monitoring and optimization functions.
Add configuration validation and permissions.
Write unit and integration tests.
Build and test the plugin on a clean Paper server.
Benchmark plugin overhead and performance changes.
Document all supported and unsupported features.
Deliver working code, not pseudocode or empty method stubs.
2. ARCHITECTURE
Organize the plugin into independent modules.
Suggested package structure:
com.upe.performance
UniversalPerformanceEngine.java — plugin entry point and lifecycle.
config/ — configuration loading, validation, defaults, and reload support.
monitoring/ — performance sampling and historical metrics.
metrics/ — TPS, MSPT, heap, GC, entity, chunk, and connection measurements.
optimization/ — safe adaptive optimization policies.
entities/ — entity statistics and optional cleanup policies.
chunks/ — chunk monitoring and supported workload controls.
memory/ — heap and garbage-collection monitoring.
commands/ — command registration, execution, and tab completion.
permissions/ — authorization checks.
reports/ — performance summaries and diagnostic exports.
integrations/ — optional integrations such as PlaceholderAPI.
util/ — formatting, validation, bounded data structures, and common helpers.
Use interfaces for optional integrations and optimization providers.
Each module must be independently testable.
The plugin must measure its own CPU time, scheduling overhead, and memory usage where practical. If its monitoring or optimization workload becomes excessive, reduce sampling frequency or disable optional diagnostics automatically.
3. PERFORMANCE MONITORING ENGINE
Build a lightweight monitoring system that collects useful server metrics.
3.1 Tick performance
Track:
TPS, using supported server metrics or a clearly documented approximation.
Average MSPT.
Minimum and maximum observed tick duration where available.
Recent tick-time history.
High-percentile tick duration when enough valid samples exist.
Duration and frequency of performance spikes.
Time spent executing UPE's own scheduled tasks.
Prefer Paper-provided metrics or established profiler integrations. Do not infer exact tick durations from unrelated timers.
Use the following configurable states as initial defaults:
Healthy: average MSPT below 40 ms.
Warning: sustained MSPT at or above 40 ms.
Critical: sustained MSPT at or above 50 ms.
Recovery: MSPT below 35 ms for a configurable period.
Use rolling windows, minimum sample counts, and hysteresis to avoid rapid state switching.
At 20 TPS, each server tick has a nominal budget of 50 ms. The objective is to keep tick duration below that budget consistently, not merely to display 20 TPS during short measurements.
3.2 Sampling requirements
Use efficient sampling intervals.
Maintain bounded metric history.
Avoid per-tick disk writes.
Avoid repeated full-world scans.
Avoid expensive reflection or profiling on every sample.
Cache static configuration and immutable metadata.
Use asynchronous file output for reports and logs.
Keep world and entity API access on the appropriate server thread.
Record unavailable metrics as unavailable, not as fabricated zero values.
3.3 Performance events
Generate diagnostic events when:
MSPT remains elevated.
Heap usage rises persistently.
Garbage-collection pauses become excessive.
Entity counts exceed configured thresholds.
Chunk-loading activity becomes unusually high.
Optional optimization tasks exceed their expected runtime.
The server repeatedly enters critical performance mode.
Each event should include the timestamp, metric, observed value, threshold, severity, and recommended investigation.
Do not automatically claim that a particular plugin is responsible unless actual profiling evidence supports that conclusion.
4. ADAPTIVE OPTIMIZATION ENGINE
Implement four operating states.
NORMAL
Collect performance metrics.
Perform only low-risk background maintenance.
Keep normal gameplay mechanics intact.
Avoid unnecessary changes to entities, chunks, or world simulation.
WARNING
Enter this state after a configurable period of sustained performance degradation.
Defer nonessential UPE maintenance tasks.
Reduce optional monitoring frequency.
Stop optional cosmetic processing implemented by UPE.
Notify authorized administrators.
Record diagnostic snapshots.
CRITICAL
Enter this state only after sustained overload, not a single slow tick.
Prioritize essential plugin functions.
Suspend nonessential report generation and optional maintenance.
Apply explicitly enabled, reversible optimization policies.
Provide clear administrative warnings.
Avoid large scans, mass entity removal, or mass chunk operations.
RECOVERY
Wait for stable performance over a configurable recovery window.
Restore suspended optional tasks gradually.
Prevent repeated state transitions using cooldowns and hysteresis.
Log the recovery and changes made.
Safety rules
The adaptive engine must never:
Disable world saving.
Disable authentication or permissions.
Bypass anti-cheat.
Skip essential game ticks.
Unload player-critical chunks unsafely.
Automatically disable unrelated plugins.
Change combat, movement, or hit detection to hide lag.
Kill valuable entities to improve metrics without an explicitly configured policy.
Every automatic change must identify the reason it was triggered and the settings it modified.
Default automatic behavior must be conservative.
5. ENTITY OPTIMIZATION
The plugin must first measure entity workload and only then apply approved optimizations.
Monitoring
Provide configurable monitoring for:
Hostile mobs.
Passive mobs.
Villagers.
Water mobs.
Flying mobs.
Dropped items.
Experience orbs.
Projectiles.
Vehicles.
Other supported entity categories.
Record counts by world and category. Provide optional diagnostic summaries of unusually dense areas without continuously scanning every entity in every world.
Optional optimization features
Configurable dropped-item lifetime.
Optional cleanup of excess dropped items.
Configurable maximum item accumulation where safely implemented.
Detection of unusually high entity densities.
Warnings about entity-heavy areas.
Optional entity activation or simulation recommendations.
Optional integration with documented Paper configuration settings.
Protection requirements
Respect:
Named entities.
Tamed and player-owned entities.
Protected-region integrations.
Entities marked as persistent.
Bosses and gameplay-critical entities.
Server-defined exceptions.
Do not treat every living entity as disposable.
Item cleanup must be disabled by default. If enabled, use a clear whitelist and blacklist policy, conservative age thresholds, and an administrator-visible audit trail.
Do not change vanilla entity behavior unless the administrator has explicitly enabled the relevant policy.
6. CHUNK AND WORLD OPTIMIZATION
Implement chunk workload monitoring and safe scheduling.
Required capabilities:
Track loaded chunk counts where accessible.
Monitor supported chunk-load events and rates.
Detect unusually high chunk activity.
Identify repeated chunk-loading pressure.
Defer optional plugin maintenance during high load.
Provide administrator-facing recommendations for simulation distance, view distance, and world configuration.
Offer integration guidance for established chunk pre-generation tools.
Avoid repeatedly iterating through every loaded chunk.
Avoid synchronous disk I/O on the main server thread.
Any concurrent chunk-loading limit must use a real supported mechanism. If Paper does not expose a safe public control for a requested operation, report the limitation instead of inventing an implementation.
Never modify chunk files directly.
Never unload chunks containing players or essential gameplay automatically.
Do not use asynchronous world access unless the selected API explicitly permits the operation.
World simulation settings must be presented as recommendations or separately managed server configuration, not silently changed behind the administrator's back.
7. MEMORY AND JVM MONITORING FOR 12 GB RAM
Treat 12 GB as the available server allocation, not a target that the plugin should consume.
Monitor:
JVM maximum heap.
Current heap usage.
Heap utilization percentage.
Committed heap where available.
Garbage-collection counts and durations.
Changes in memory pressure over time.
Sustained growth patterns that may warrant further profiling.
Use supported JVM management interfaces such as java.lang.management.ManagementFactory and its memory and garbage-collection management interfaces.
Clearly distinguish heap metrics from operating-system process memory.
Do not claim that a high heap percentage alone proves a memory leak.
Initial thresholds
Warning heap usage: 80%.
Critical heap usage: 90%.
Sustained high usage: evaluate over multiple samples.
GC warnings: based on measured pause duration and frequency, not arbitrary assumptions.
Allow all thresholds to be configured.
Safety
Never:
Invoke System.gc() repeatedly as an optimization mechanism.
Force aggressive garbage collection during gameplay.
Allocate large buffers merely to reserve memory.
Increase heap usage deliberately.
Attempt to change JVM startup flags at runtime.
Automatically restart the server without an explicit external policy.
Provide separate guidance on JVM startup flags and host-level memory limits.
Do not prescribe one universal heap size or garbage collector configuration for every 12 GB host. The correct configuration depends on server workload, available physical RAM, JVM version, and hosting environment.
8. NETWORK AND CONNECTION DIAGNOSTICS
Monitor available connection metrics without introducing packet interception overhead unnecessarily.
Where supported, report:
Online player count.
Connection and disconnection rates.
Repeated connection failures exposed by supported events.
Optional plugin-message volume generated by UPE.
Unusual request patterns relevant to UPE features.
Network-related warnings that require further diagnosis.
Do not claim to measure exact ping, packet loss, bandwidth, or routing quality unless reliable metrics are available.
Do not implement custom protocol manipulation merely for a performance claim.
Do not weaken authentication, encryption, rate limiting, or anti-cheat.
Never punish players solely because their connection is slow.
Network diagnostics should help administrators distinguish server overload from network problems rather than automatically attributing all lag to one cause.
9. CLIENT FPS AND DEVICE SUPPORT
A server-side Paper plugin cannot directly control arbitrary client graphics settings or guarantee an FPS increase.
Implement two distinct layers.
Layer A: Server-side optimization
Reduce server-generated causes of poor responsiveness through measured improvements in entity processing, chunk activity, scheduling, and redundant UPE operations.
Layer B: Optional client companion
Design a separate optional client-side mod only if the project explicitly includes a compatible client platform and the required development scope.
Potential client-side features include:
Reduced nonessential particles.
Optional cosmetic-effect limits.
Adjustable visual-detail presets.
Render-distance recommendations.
Optional visual clutter reduction.
Player-selected low, balanced, and high-performance profiles.
Do not claim that a Paper plugin alone can force these settings on unmodified clients.
Do not install client software remotely.
Do not use invasive hardware fingerprinting.
Do not require a client mod for players to connect to the server unless the server owner has separately chosen and clearly communicated that requirement.
Device profiles must be voluntary and must not give players unfair gameplay advantages.
10. ADMINISTRATIVE COMMANDS
Register the root command /upe.
Implement the following commands with proper validation, permission checks, helpful error messages, and tab completion.
Information commands
/upe help — Display command help.
/upe version — Display UPE and server compatibility information.
/upe status — Show current performance metrics.
/upe history — Show recent performance states.
/upe report — Generate a diagnostic report.
/upe recommendations — Show evidence-based recommendations.
/upe inspect entities — Display supported entity diagnostics.
/upe inspect chunks — Display supported chunk diagnostics.
Optimization commands
/upe mode normal
/upe mode warning
/upe mode critical
/upe profile low
/upe profile balanced
/upe profile high
/upe profile custom
Manual mode changes must be permission-controlled and clearly distinguished from automatic state transitions.
A profile may change only settings that UPE actually controls. If a setting belongs to Paper's server configuration, display the required administrative action rather than pretending it was changed.
Administration commands
/upe reload — Reload and validate supported plugin configuration.
/upe debug on
/upe debug off
/upe diagnostics — Show diagnostic availability and profiler integration status.
/upe pause — Pause optional UPE optimization tasks.
/upe resume — Resume optional UPE optimization tasks.
The pause command must not disable core monitoring, essential server systems, or unrelated plugins.
Never implement /reload as a mechanism for reloading the entire server or all plugins.
11. PERMISSIONS AND SECURITY
Register granular permissions in plugin.yml.
Suggested permissions:
upe.command.help
upe.command.version
upe.command.status
upe.command.history
upe.command.report
upe.command.recommendations
upe.command.inspect
upe.command.profile
upe.command.mode
upe.command.reload
upe.command.debug
upe.command.pause
upe.admin
All administrative permissions should default to operator-only unless a command is explicitly intended for public access.
Console execution must work for appropriate administrative commands.
Validate all user input. Never concatenate arbitrary user-provided strings into file paths or shell commands.
Do not execute arbitrary operating-system commands.
Do not expose internal file paths, sensitive diagnostics, or administrative actions to unauthorized players.
The plugin must not send telemetry or player hardware data to an external server without explicit, documented consent.
12. CONFIGURATION FILE
Create plugins/UniversalPerformanceEngine/config.yml with comprehensive comments and validated defaults.
Use the following as a starting template:
general:
language: en
debug: false
metrics-enabled: true
automatic-optimization: true
monitoring:
interval-seconds: 5
history-minutes: 30
warning-mspt: 40.0
critical-mspt: 50.0
recovery-mspt: 35.0
warning-duration-seconds: 30
critical-duration-seconds: 15
recovery-duration-seconds: 60
adaptive:
enabled: true
cooldown-seconds: 60
hysteresis-enabled: true
defer-optional-tasks: true
automatic-entity-cleanup: false
automatic-world-config-changes: false
entities:
monitoring-enabled: true
inspect-on-demand: true
item-cleanup-enabled: false
item-cleanup-age-seconds: 300
protect-named-entities: true
protect-tamed-entities: true
protect-persistent-entities: true
protect-bosses: true
chunks:
monitoring-enabled: true
inspect-on-demand: true
concurrent-load-limit-enabled: false
concurrent-load-limit: 8
pre-generation-integration: false
memory:
monitoring-enabled: true
warning-heap-percent: 80.0
critical-heap-percent: 90.0
gc-monitoring-enabled: true
network:
monitoring-enabled: true
connection-rate-monitoring: true
client:
companion-mod-enabled: false
allow-optional-client-profiles: true
reports:
enabled: true
save-interval-minutes: 15
retain-days: 7
logging:
automatic-adjustments: true
performance-warnings: true
audit-destructive-actions: true
This configuration is illustrative. Every option must correspond to actual implemented functionality.
In particular, do not expose a chunk concurrency limit as an operational setting unless the implementation truly controls that limit using a supported mechanism.
Validate numeric ranges, reject invalid configuration safely, and report each rejected value clearly.
Keep optional destructive actions disabled by default.
13. PERFORMANCE REPORTS
Generate reports containing:
Server software and version.
Java runtime version.
UPE version.
Uptime where available.
Current player count.
Current and historical TPS/MSPT measurements where available.
Heap and garbage-collection metrics.
Entity counts by category where measured.
Chunk counts and activity where measured.
Current optimization state.
Recent automatic changes.
Monitoring overhead.
Known unavailable metrics.
Recommended next steps.
Save reports asynchronously in the plugin's data directory.
Use bounded storage and configurable retention.
Do not include IP addresses, authentication information, private player data, or hardware identifiers in reports unless specifically necessary, legally appropriate, and explicitly authorized.
Provide a concise in-game summary and a more detailed console or file report.
14. PROFILER INTEGRATION
Paper versions that bundle Spark should use Spark as the preferred detailed profiling tool.
The plugin should:
Detect whether the relevant profiler is available.
Explain how administrators can collect a profile during a real performance issue.
Offer documented manual profiling instructions.
Avoid requiring Spark as a hard dependency unless the project genuinely needs it.
Avoid running expensive profiling continuously.
Never claim to identify the slowest plugin or method without adequate profiling evidence.
Provide instructions for capturing a profiler report when lag occurs, rather than only after the server returns to normal.
15. PAPER CONFIGURATION GUIDANCE
The plugin must explain which optimizations belong in UPE and which belong in Paper's own configuration.
Provide a separate administrator guide for evaluating:
view-distance.
simulation-distance.
Entity activation ranges.
Spawn limits and spawn ranges.
Chunk-loading workload.
World-specific settings.
Mob farms and villager-heavy areas.
Plugin and datapack workload.
JVM configuration and garbage-collection behavior.
Do not blindly overwrite server.properties, paper-global.yml, paper-world-defaults.yml, spigot.yml, or world-specific configuration.
Where settings vary by Paper version, use the documentation matching the target release.
For every recommendation, explain its expected benefit, possible gameplay impact, and how to revert it.
16. RESOURCE AND CPU EFFICIENCY
UPE must not become a performance bottleneck.
Requirements:
Avoid creating one repeating task per player or entity.
Avoid blocking disk and network operations on the main server thread.
Use bounded queues and collections.
Use minimal event listeners.
Avoid excessive string construction and logging in hot paths.
Avoid repeated configuration parsing.
Avoid unnecessary object allocation during frequent sampling.
Use asynchronous tasks only for operations safe to perform asynchronously.
Cancel tasks and close resources cleanly when the plugin disables.
Apply configuration reloads safely without restarting every subsystem unnecessarily.
Avoid retaining references to disconnected players or unloaded worlds.
Measure the cost of monitoring and optional optimization features.
Use Paper's supported scheduling APIs and respect its main-thread and asynchronous execution rules.
17. TESTING AND ACCEPTANCE CRITERIA
Create unit tests for configuration validation, adaptive-state transitions, hysteresis, cooldowns, metrics calculations, report generation, and permission checks.
Create integration tests for plugin startup, shutdown, command registration, invalid configuration, and optional dependency handling.
Test in a real Paper server using representative workloads.
Required scenarios:
Empty server.
Normal survival gameplay.
Multiple concurrent players.
High entity density.
Chunk-loading pressure.
Villager-heavy areas.
Automated farms and redstone activity.
Repeated player joins and disconnects.
Memory pressure and GC activity.
Sustained MSPT spikes.
Recovery after overload.
Long-duration operation.
Interaction with popular third-party plugins.
Compare baseline performance against performance with UPE enabled under comparable conditions.
Measure:
MSPT distribution and high-percentile tick duration.
TPS stability.
CPU utilization.
Heap usage and GC pauses.
Chunk and entity workload.
UPE's own CPU and memory overhead.
Client FPS in controlled client-side tests, if a companion mod is included.
Document hardware, JVM, server version, player count, world conditions, test duration, and measurement methods.
Do not fabricate benchmark results.
Do not promise a particular FPS increase or a particular percentage reduction in MSPT without reproducible measurements.
18. FINAL DELIVERABLES
Deliver:
Complete Java source code.
Gradle or Maven build files.
plugin.yml.
Default config.yml.
Compiled plugin JAR.
Unit and integration tests.
Installation and upgrade guide.
Command and permission documentation.
Paper configuration recommendations.
Compatibility matrix.
Troubleshooting guide.
Benchmarking instructions.
Known limitations and unsupported features.
Optional companion client mod as a separate deliverable, if included in scope.
The JAR must be built successfully and tested against the declared target version.
If a tool or environment cannot run a live Paper server, clearly disclose that limitation instead of claiming live-server testing was completed.
19. FINAL IMPLEMENTATION DIRECTIVE
Start by verifying the exact Paper and Minecraft versions and choosing compatible Java and API versions.
Then implement the plugin in small, testable modules. Ensure that every command, configuration option, metric, and optimization has real behavior.
Prioritize low overhead, stability, safe automatic optimization, and evidence-based diagnosis over aggressive changes.
The final product should make a 12 GB Paper server run as efficiently and consistently as reasonably possible, while preserving gameplay and helping players on a broad range of devices enjoy a smoother experience.
Do not substitute marketing claims for working code or measurable results.