ChunkDeleter
Advanced chunk cleaner plugin that deletes unused chunks for Paper/Folia servers
Quick challenge
How far can you run before the mobs catch you?
Minecraft check
Confirm your run
Complete the quick check to get your code.
ChunkDeleter
ChunkDeleter
Advanced chunk cleaner plugin for Paper/Folia servers that automatically deletes chunks that haven't been entered by players for a specified amount of time.
Features
🚀 Advanced Scheduling
- PerfoBooster Integration: Fully compatible with Folia's threaded region scheduler - PerfoBooster Integration: Falls back to standard scheduler for Paper/Spigot servers - PerfoBooster Integration: All operations use appropriate schedulers for thread safety - PerfoBooster Integration: Automatic detection and optimization with PerfoBooster plugin
🛡️ Smart Protection System
- Build Detection: Protects chunks around world spawn points - Build Detection: Protects chunks near online players - Build Detection: Protects chunks containing important structures (portals, beacons, etc.) - Build Detection: Protects chunks with storage blocks, furnaces, and other important blocks - Build Detection: Recognizes player-built structures and protects them
⚙️ Flexible Configuration
- Performance Tuning: Modern, clean configuration format - Performance Tuning: Set how long chunks must be unused before deletion - Performance Tuning: Two-phase deletion with marking and grace period - Performance Tuning: Enable/disable for specific worlds - Performance Tuning: Adjustable batch sizes and processing limits
📊 Basic Tracking & Logging
- Real-time Monitoring: Efficient chunk access tracking - Real-time Monitoring: Detailed chunk deletion logs saved to `logs/latest.txt` - Real-time Monitoring: Precise chunk and block coordinate tracking - Real-time Monitoring: Detailed statistics on scanned, deleted, and protected chunks - Real-time Monitoring: Track chunk access in real-time
🎛️ Easy Management
- Auto-Optimization: Full command interface for management - Auto-Optimization: View, tail, and clear log files in-game - Auto-Optimization: Granular permission control - Auto-Optimization: Reload configuration without restart - Auto-Optimization: Trigger cleanup cycles manually - Auto-Optimization: One-click PerfoBooster installation
Installation
1. Download the ChunkDeleter JAR file 2. Place it in your server's `plugins` folder 3. Restart your server 4. Configure the plugin in `plugins/ChunkDeleter/config.yml` 5. (Optional) Use `/chunkdeleter optimize` to install PerfoBooster for enhanced performance
Commands
Core Commands
- `/chunkdeleter help` - Show help information - `/chunkdeleter reload` - Reload plugin configuration - `/chunkdeleter stats` - Show chunk statistics - `/chunkdeleter clean` - Manually trigger cleanup - `/chunkdeleter toggle` - Enable/disable chunk deletion - `/chunkdeleter info` - Show plugin information
Advanced Commands
- `/chunkdeleter optimize` - Download and install PerfoBooster plugin - `/chunkdeleter logs` - View log file information - `/chunkdeleter logs tail [lines]` - Show recent log entries (1-50 lines) - `/chunkdeleter logs clear` - Clear the log file - `/chunkdeleter debug` - Toggle debug mode (admin only)
Aliases: `/cd`, `/chunkdel`
Permissions
- `chunkdeleter.*` - Access to all features (default: op) - `chunkdeleter.admin` - Full administrative access - `chunkdeleter.reload` - Permission to reload config - `chunkdeleter.stats` - View statistics - `chunkdeleter.clean` - Trigger manual cleanup - `chunkdeleter.toggle` - Enable/disable plugin - `chunkdeleter.optimize` - Download PerfoBooster plugin - `chunkdeleter.logs` - View and manage log files
Configuration
The plugin uses a modern camelCase configuration format. The config file includes:
```yaml
Enable/disable the plugin
enabled: true
Chunk deletion settings
chunkDeletion: timeBeforeDeletion: 30 # Minutes before chunk is eligible for deletion maxChunksPerCycle: 50 # Maximum chunks to process per cycle cleanupInterval: 300 # Cleanup interval in seconds immediateDeletion: false # Enable immediate deletion or use grace period gracePeriod: 5 # Grace period in minutes for marked chunks
World settings
worlds: enabledWorlds: [] # Specific worlds to enable (empty = all worlds) disabledWorlds: # Worlds to exclude - "world_nether" - "world_the_end" spawnProtectionRadius: 10 # Chunk radius around spawn to protect
Protection settings
protection: protectPlayerChunks: true # Protect chunks near players playerProtectionRadius: 3 # Player protection radius in chunks protectStructures: true # Protect chunks with structures protectTileEntities: true # Protect chunks with storage/functional blocks minTileEntities: 1 # Minimum tile entities to protect chunk
Performance settings
performance: asyncScanning: true # Use async processing maxProcessingTimePerTick: 10 # Max processing time per tick (ms) batchSize: 25 # Batch size for operations
Logging settings
logging: logDeletions: true # Log chunk deletions to console logStatistics: true # Log statistics periodically statisticsInterval: 60 # Statistics interval in minutes debug: false # Enable debug logging
Database settings
database: type: SQLITE # Database type (SQLITE, MYSQL, or MEMORY) sqliteFile: "chunkdata.db" # SQLite file name mysql: # MySQL settings (if using MYSQL) host: "localhost" port: 3306 database: "chunkdeleter" username: "username" password: "password" ```
Logging System
ChunkDeleter includes a basic logging system that tracks all chunk deletions:
Log File Location
- Thread-Safe: `logs/latest.txt` (in your server root directory) - Thread-Safe: Timestamped entries with detailed coordinate information - Thread-Safe: Safe for concurrent access and high-performance servers
Log Entry Format
``` [2024-01-15 14:30:25] CHUNK_DELETED: World=world, ChunkCoords=[15,11], BlockRange=[240,176] to [255,191], Info=Automatic cleanup [2024-01-15 14:31:02] Manual cleanup triggered by admin [2024-01-15 14:35:10] Cleanup cycle: Processed 45, Deleted 12, Protected 33 chunks ```
Log Management Commands
- `/chunkdeleter logs` - View log file information and statistics - `/chunkdeleter logs tail 20` - Show the last 20 log entries - `/chunkdeleter logs clear` - Clear the log file (admin only)
PerfoBooster Integration
ChunkDeleter automatically detects and integrates with PerfoBooster for optimal performance:
Automatic Detection
- Installation Warnings: Checks for Minecraft 1.20.1 with RegionScheduler support - Installation Warnings: Validates Paper/Folia/Purpur server software - Installation Warnings: Shows warnings if PerfoBooster is recommended but not installed
Easy Installation
- Safety Checks: Use `/chunkdeleter optimize` to automatically download and install PerfoBooster - Safety Checks: Always downloads the latest compatible version - Safety Checks: Prevents installation on incompatible servers
Performance Benefits
When PerfoBooster is installed on compatible servers: - Reduced server lag during chunk operations - Optimized redstone and entity processing - Enhanced performance for large-scale chunk cleanup operations
How It Works
1. Basic Logging: The plugin tracks when players enter chunks using move and teleport events 2. Basic Logging: Access times are stored in a SQLite database for persistence 3. Basic Logging: Configurable cleanup cycles check for old chunks 4. Basic Logging: Multiple protection systems prevent important chunks from deletion 5. Basic Logging: Chunks are safely unloaded and removed from tracking 6. Basic Logging: All operations are logged with detailed coordinates and timestamps
Performance Considerations
- PerfoBooster Integration: Most operations run asynchronously to avoid server lag - PerfoBooster Integration: Chunks are processed in configurable batches - PerfoBooster Integration: SQLite with optimized queries and indexing - PerfoBooster Integration: Frequently accessed chunks are cached in memory - PerfoBooster Integration: Uses region schedulers for optimal Folia performance - PerfoBooster Integration: Enhanced performance with PerfoBooster plugin
Compatibility
- Optional Dependencies: 1.20 (PerfoBooster requires 1.20.1) - Optional Dependencies: Paper, Folia, Purpur, Spigot - Optional Dependencies: 17 - Optional Dependencies: PerfoBooster (auto-installable)
Support
For support, join discord: https://discord.gg/yUghaxRSZs