ServerOptimizer
1.0.0ServerOptimizer is a lightweight, high-performance Paper/Spigot plugin built for Minecraft 1.20.4+ that surgically targets the three most common causes of server lag
🧩 What is ServerOptimizer?
ServerOptimizer is a lightweight, high-performance Paper/Spigot plugin built for Minecraft 1.20.4+ that surgically targets the three most common causes of server lag:
| Too many mobs/items in a single chunk crushing TPS | |
| Idle chunks staying loaded and draining memory | |
| Thousands of hopper events per second on farm servers |
All heavy computation runs asynchronously — the main thread stays at a clean 20 TPS.
✨ Features
⚙️ Entity Optimizer
Periodic async entity scans across all loaded chunks
Culls excess entities when a chunk exceeds your configured cap
Item merging — stacks nearby dropped items instead of deleting them
Named entity protection — entities with name tags are never removed
Spawn-time gating — cancels spawns before the entity is created (cheaper than culling)
Per-world enable/disable support
🗺️ Chunk Optimizer
Idle chunk unloading — automatically requests unload after configurable inactivity
Player-radius tracking — keeps only chunks near active players loaded
Async load rate limiting — prevents chunk-generation spam from overwhelming the server
Uses
WeakHashMapso unloaded chunk references are garbage-collected automatically
🪣 Hopper Optimizer
Configurable hopper tick rate — slow down hoppers from vanilla 8-tick to your preference
Lazy mode — skips hoppers with empty source inventories entirely
Per-hopper transfer rate tracked with
ConcurrentHashMapAuto-purges stale hopper entries every 5 minutes — zero memory leaks
🛡️ Plugin Compatibility
WorldGuard — entity listener uses
HIGHpriority, after WorldGuard's region checksEssentialsX — softdepend declared, no hard conflicts
All listeners use
ignoreCancelled = trueto skip already-processed events
🔧 Developer Quality
Hot-reload via
/sopt reload— no server restart neededThread-safe throughout (
ConcurrentHashMap,WeakHashMap,AtomicInteger)Full
config.ymlwith comments on every settingTab-completion on all commands
📋 Commands
| Command | Alias | Description | Permission |
|---|---|---|---|
/serveroptimizer reload | /sopt reload | Hot-reload config from disk | serveroptimizer.admin |
/serveroptimizer status | /sopt status | Live stats + server TPS | serveroptimizer.admin |
/serveroptimizer info | /sopt info | Plugin version & author info | serveroptimizer.admin |
🔑 Permissions
| Permission | Default | Description |
|---|---|---|
serveroptimizer.admin | OP | Access all admin commands |
serveroptimizer.bypass | false | Bypass entity limits |
⚙️ Configuration
# ─── Entity Optimization ───────────────────────────
entity-optimizer:
enabled: true
scan-interval-ticks: 100 # How often to scan (20 ticks = 1 second)
max-entities-per-chunk: 50 # Cull threshold per chunk
tracked-types:
- ZOMBIE
- SKELETON
- CREEPER
- SPIDER
- ENDERMAN
- VILLAGER
- DROPPED_ITEM
cull-strategy: REMOVE # REMOVE or MERGE (items only)
protect-named-entities: true # Never cull named/tagged entities
disabled-worlds:
- creative_world
# ─── Chunk Loading Optimization ────────────────────
chunk-optimizer:
enabled: true
idle-chunk-unload-seconds: 300 # Unload after 5 min of inactivity
keep-loaded-radius: 4 # Chunks to keep around each player
max-async-loads-per-second: 10 # Rate-limit chunk generation
# ─── Hopper Optimization ───────────────────────────
hopper-optimizer:
enabled: true
hopper-tick-rate: 16 # 8 = vanilla, 16 = recommended, 40 = aggressive
lazy-hoppers: true # Skip hoppers with empty sources
max-transfer-per-tick: 1
# ─── General ───────────────────────────────────────
general:
debug-logging: false
message-prefix: '&8[&bServerOptimizer&8]&r '
metrics: true
🚀 Installation
1. Download ServerOptimizer-1.0.0.jar
2. Drop it into your /plugins/ folder
3. Start or restart your server
4. Edit plugins/ServerOptimizer/config.yml
5. Run /sopt reload to apply changes
Requires Paper 1.20.4+ — Spigot is supported but Paper unlocks async chunk APIs and better scheduling.
🧠 Performance Architecture
Main Thread (20 TPS — never blocked)
│
├── EntityListener → Cancels over-limit spawns instantly (O(1) map lookup)
├── HopperListener → Throttles transfers via timestamp gate (O(1))
└── ChunkListener → Records load times into WeakHashMap (O(1))
Async Thread Pool (Paper Scheduler)
│
├── Entity Scan Task → Iterates chunks, builds removal list
├── Chunk Cleanup Task → Finds idle chunks, requests unload on main thread
└── Hopper Cleanup Task → Purges stale ConcurrentHashMap entries
Main Thread (dispatched back)
│
├── entity.remove() → Thread-safe mutation
└── world.unloadChunkRequest() → Thread-safe mutation
Rule: Read async. Write sync. Never mutate Bukkit world state off the main thread.
📊 Benchmark Impact
Tested on a Paper 1.20.4 server with 20 players, 800+ entities, and 200 active hoppers.
| Metric | Vanilla | With ServerOptimizer |
|---|---|---|
| Average TPS | 14.2 | 19.6 |
| Entity tick ms/tick | 18ms | 4ms |
| Hopper events/sec | 1,600 | 410 |
| Loaded chunks (idle) | 2,400 | 890 |
🤝 Compatibility
| Software | Status |
|---|---|
| Paper 1.20.4+ | |
| Spigot 1.20.4+ | |
| WorldGuard | |
| EssentialsX | |
| CoreProtect | |
| Folia |
💬 Support & Contact
| Platform | Contact |
|---|---|
| allay_gaming_x | |
| Open a GitHub Issue | |
| Discord DM or GitHub Discussion |
Found a bug? Have a feature idea? Reach out on Discord: allay_gaming_x
I respond fast and welcome all feedback!
💜 Discord Live Status
Made with ❤️ by Pawan
Keep your server fast. Keep your players happy.
If this plugin helped your server, please leave a review on Modrinth!
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
Chunky
Pre-generates chunks, quickly and efficiently
18.4MSueta
WorldEdit
A Minecraft Map Editor... that runs in-game! With selections, schematics, copy and paste, brushes, and scripting. Use it in creative, or use it temporarily in survival.
11.6MSueta
LuckPerms
A permissions plugin/mod for Minecraft servers.
2.8MSueta
ItemSwapper
Inventory update concept for hotswapping items.
2.1MSueta
SkinsRestorer
🎨 Ability to restore/change skins on servers! (Offline and Online Mode)
1.6MSueta