ClearEntity Advanced Entity & Lag Management for Spigot 1.20.1+
Welcome to ClearEntity! This plugin is your comprehensive solution for scanning, clearing, and managing entities on your Minecraft server. Developed for Spigot 1.20.1+, ClearEntity also helps identify high-density entity zones and potentially lag-inducing special blocks, keeping your server performance optimal.
✨ Core Features
Comprehensive Entity Scanning: Scan and get a detailed count of all entities currently loaded on your server.
Targeted Entity Clearing: Precisely remove all entities of a specific type.
Lag Block Detection: Scan for special blocks known to potentially cause server lag (e.g., Hoppers, Droppers, Dispensers).
High-Density Area Detection:
Grid-Based Algorithm: Intelligently scans for both high-density entity and block areas using a grid system to avoid redundant scans and prevent server overload.
Configurable Thresholds: Define the scan radius and minimum entity/block count to identify problematic zones.
Teleport to Hotspots: Instantly teleport to identified high-density areas for manual inspection and resolution.
Multi-Language Support: Comes with built-in support for English and Chinese (中文).
Localized Names: Displays entity and block names in the configured language for user-friendly interaction.
Commands
All commands require the permission: clearentity.admin
Basic Commands:
/ce scan - Scans and provides a statistical overview of all entities in loaded chunks.
/ce scanblock - Scans for potentially lag-inducing special blocks as defined in the configuration.
/ce clear <EntityType> - Clears all entities of the specified type. (e.g., `/ce clear ZOMBIE`)
/ce reload - Reloads the plugin's configuration files (`config.yml` and `message.yml`).
Density Scanning & Teleportation:
/ce scansize <range> <threshold> - Scans for high-density entity areas within a specified range where entity counts exceed the threshold.
<range>: The radius of the scan in blocks.
<threshold>: The minimum number of entities of the same type to trigger a high-density report.
Example: `/ce scansize 20 30` - Scans for areas within a 20-block radius containing 30 or more entities of the same type.
/ce tp <AreaID> - Teleports you to a high-density area identified by the `scansize` command.
<AreaID>: The numerical ID of the area displayed after running `scansize`.
Example: `/ce tp 1` - Teleports you to the high-density area labeled as #1.
Note: All commands feature robust Tab-completion for easy use.
Permissions
clearentity.admin - Grants access to all ClearEntity commands and functionalities. Essential for server administrators.
⚙️ Configuration
ClearEntity is highly configurable via `config.yml` and `message.yml` located in the `/plugins/ClearEntity/` directory.
config.yml:
Code (YAML):
# Debug mode # Enable to see more detailed console output for troubleshooting. debug: false
# Language setting (zh: Chinese, en: English) # When set to 'en', vanilla item names are not translated by the plugin's system. # The plugin will use Minecraft's default localization for English. lang: en
# List of block types considered potentially lag-inducing. # These are scanned by the /ce scanblock command. # You can add or remove Material names from this list. # Common examples: # HOPPER - High-frequency item transport # DROPPER - Item transport # DISPENSER - Item transport and interaction # COMPARATOR - Redstone signal detection lag-causing-blocks: - HOPPER
- DROPPER
- DISPENSER
- COMPARATOR
- OBSERVER
- REDSTONE_WIRE
- POWERED_RAIL
# ... add more Material names as needed
IGNORE_WHEN_COPYING_START
Use code
with caution. Bbcode
IGNORE_WHEN_COPYING_END
message.yml:
[]All plugin messages, including command feedback and UI text, are managed in message.yml. []This file allows for full localization. By default, English and Chinese translations are provided.
Switch the language by changing the lang setting in config.yml.
Technical Highlights
[]Efficient Grid-Based Scanning: Utilizes a hash map to partition the world into a grid. This prevents re-scanning the same areas, drastically improving performance and avoiding server crashes during large-scale scans. []Type-Grouped Processing: Entities are grouped and processed by their type, leading to more efficient scanning and clearing operations. []Distributed (Ticked) Scanning: Large scanning tasks are broken down and spread across multiple server ticks. This ensures that scans do not cause noticeable server lag or TPS drops. []Dynamic Tab Completion: All commands and their parameters support intuitive tab completion, making them easier and faster to use. []Robust Multi-Language Engine: Messages are externalized to message.yml, allowing for easy translation and addition of new languages. []Localized Naming System: Entity and block names are displayed in the server's or user's configured language (via minecraft_lang.yml), enhancing user experience.