Develop a fully optimized Minecraft plugin for Paper 1.21.11, using Java 21. The plugin combines an automatic map reset system, WorldGuard region protection, and ClearLag item cleanup.
- World Reset System
Reset the entire configured world every 10 minutes by default.
Restore all blocks to their original state, including blocks placed or broken by players.
The reset interval must be configurable in config.yml.
Use an efficient snapshot, backup, or other reliable reset method. Do not save unnecessary data every tick.
The reset must restore the original terrain, ores, blocks, and other block states.
Send configurable warning messages before the reset (e.g., 60 seconds and 10 seconds remaining).
Notify all online players when the reset starts and finishes.
Make sure the reset system is safe, reliable, and optimized for servers with many players.
Prevent players from exploiting the reset process or duplicating items during resets.
Do not freeze the entire server while resetting. Use asynchronous processing where safe, and perform Bukkit world modifications on the main thread when required.
Provide a configurable option to enable or disable automatic resets.
- WorldGuard Region Protection
Integrate directly with WorldGuard. I need three region types, with unlimited configurable regions of each type.
A. Protected Regions
Examples: spawn, afk, and any other regions I define.
Players cannot place or break any blocks inside these regions.
This protection must apply to Survival players and must not be bypassable through normal gameplay mechanics.
Region names must be configurable.
Allow administrators to add or remove protected regions without editing Java code.
B. Normal Regions
Players in Survival can place blocks and break blocks placed by other players.
Players must NOT be able to break the original terrain or naturally generated blocks.
Track player-placed blocks accurately and efficiently.
This must work across server restarts.
Support unlimited configurable regions of this type.
C. Mine Regions
Players can place and break blocks freely inside these regions.
Allow unlimited configurable mine regions.
Mine regions must be configurable independently from protected and normal regions.
Region Requirements
Support any number of regions for each type, not just three.
Integrate correctly with WorldGuard priorities and overlapping regions.
Provide clear configuration options for each region type.
Allow administrators to manage region assignments using in-game commands.
Include permission-based admin bypass where appropriate.
Do not cancel unrelated events outside the configured regions.
- Prevent Placing Blocks on Partial Blocks
Prevent players from placing blocks on top of partial blocks, including:
Slabs (top and bottom).
Stairs.
Fences and walls.
Trapdoors.
Carpets.
Other configurable partial blocks or blocks with non-full collision shapes.
The goal is to prevent players from using these blocks as a surface to place another block on top of them, especially for building traps or gaining unintended advantages.
Make the block list configurable.
Apply the restriction only where appropriate, without breaking normal placement mechanics elsewhere.
Ensure the restriction works with both Java and Bedrock players using Geyser/Floodgate.
Avoid false positives with normal full-block placement.
- ClearLag Item Cleanup
Implement a built-in ClearLag system that automatically removes dropped items from the ground.
Requirements:
Configurable cleanup interval, defaulting to every 5 minutes.
Configurable warning messages before cleanup.
Remove dropped item entities from loaded worlds.
Add a blacklist of items that must NEVER be removed.
Support blacklisting by material type and, optionally, custom item name or identifier.
Blacklisted items must survive every automatic and manual cleanup.
Do not remove items inside player inventories, chests, ender chests, or other containers.
Only remove dropped item entities in the world.
Display the number of removed items in the cleanup message or console log.
Allow administrators to trigger cleanup manually.
Keep the cleanup lightweight and avoid unnecessary entity scans.
- Configuration
Make the plugin easy to manage through config.yml.
Include settings for:
Reset world name.
Reset interval in minutes.
Reset warnings and messages.
Automatic reset enabled/disabled.
Protected, normal, and mine regions.
Partial-block placement restrictions.
ClearLag interval and warning messages.
ClearLag item blacklist.
Debug mode.
Permission settings where appropriate.
Provide a complete example configuration with comments explaining every option.
- In-Game Commands
Create simple administrative commands so I can control the plugin without constantly editing configuration files.
Suggested commands:
/mapreset — Show reset status and time remaining.
/mapreset now — Immediately reset the configured world.
/mapreset reload — Reload the configuration safely.
/mapreset pause — Pause automatic resets.
/mapreset resume — Resume automatic resets.
/mapreset region add <protected|normal|mine> <region> — Assign a WorldGuard region type.
/mapreset region remove <region> — Remove a region assignment.
/mapreset region list — List all configured regions and their types.
/clearlag — Display cleanup status.
/clearlag now — Run cleanup immediately.
/clearlag reload — Reload ClearLag settings.
Add tab completion, clear success/error messages, permission checks, and console support where appropriate. Use a consistent permission structure such as mapreset.admin and clearlag.admin.
If a command changes the configuration, save the changes persistently so they survive restarts.
- Optimization and Reliability
Use minimal CPU and memory.
Avoid scanning every block in the world every tick.
Avoid excessive disk I/O and memory-heavy full-world copies.
Persist player-placed block tracking efficiently.
Handle server restarts and unexpected shutdowns safely.
Never allow overlapping reset tasks.
Handle offline players and unloaded chunks correctly.
Ensure ClearLag never deletes blacklisted items.
Use proper event handling and WorldGuard APIs instead of repeatedly checking region membership inefficiently.
Avoid conflicts with other plugins.
Use clean, maintainable Java code and appropriate error handling.
- Dependencies and Deliverables
Paper 1.21.11 and Java 21.
WorldGuard integration is required.
Detect missing dependencies and display clear startup errors.
Provide the complete Java source code and a ready-to-use compiled JAR.
Include plugin.yml, config.yml, and any required data files.
Include installation instructions and examples of all commands and permissions.
Ensure the project compiles successfully before delivering it.
Important: Do not provide pseudocode, incomplete methods, or a basic prototype. Implement all features fully, test the important scenarios, and prioritize correctness, performance, and easy administration.
Should I create a new Paper plugin project for this, or is it for an existing project you’ll add to the workspace?
new
I’ve started the new Paper plugin project and delegated the full implementation, including WorldGuard integration, configurable world resets, region protection, partial-block restrictions, ClearLag, commands, and documentation. I’ll compile it once the implementation is finished.
…Implemented the Paper 1.21.11 / Java 21 plugin with:
A quiesced, disk-backed world baseline, staged asynchronous restore, restart recovery marker, and blocked player interactions during reset.
WorldGuard region assignments, persistent per-chunk placed-block tracking, and top-face partial-support restrictions.
Scheduled and cancellable ClearLag scans for loaded chunks, with material, display-name, and persistent-key blacklists.
Commands, permissions, commented defaults, Gradle setup, and operational documentation in
README.md.
No build or tests were run.
The plugin compiled successfully for Paper 1.21.11 and Java 21. The project includes the source, configuration, plugin.yml, and README with installation and command instructions.
Install the compiled JAR on a Paper server with WorldGuard installed. Compilation succeeded; runtime scenarios were not independently tested.
No files in this session