🧹 X-ClearLagβš™οΈ Base Configuration

Configuration

Deep customization to tailor cleaning logic to your server's needs.

Customize cleanup logic and intervals in config.yml.

πŸ€” What is it for?

The config.yml file is the brain of X-ClearLag. Here you decide when, how, and what is cleared on your server. You can create automatic routines (e.g., clearing items on the floor every so often) or configure the system to only clear when the server starts having significant lag (low TPS).

prefix: "&8[&bX-ClearLag&8] &7"
language: "en"
 
# TPS Monitoring and Auto-Cleanup
tps-check:
  enabled: true
  threshold: 16.0
  interval: 60
  task-to-run: ["clearlag"]
  cooldown-seconds: 60 # Cooldown between automatic cleanups
 
# Worlds where the plugin is disabled
worlds:
  blacklist: ["world_nether_test"]
 
# Global Optimizations
optimizations:
  batch-size: 0 # 0 to disable, >0 to clean in batches (prevents lag spikes)
  intelligent-protection:
    named-mobs: true
    named-items: true
    player-radius: 1 # Distance from players to protect entities (blocks)
    type-whitelist: ["ARMOR_STAND", "VILLAGER"]
 
# Manual Clear command (/xcl clear) configuration
manual-clear:
  enabled: true
  tasks: ["clearlag"]
  allow-specific: true
  broadcast: true
  ignore-min-players: true
  instant: true
  cooldown: 30
 
tasks:
  clearlag:
    enabled: true
    interval: 300
    min-players: 3
    countdown: [60, 30, 10, 5, 3, 2, 1]
    remove-drops: true
    entities: [ARROW, SPECTRAL_ARROW]
    protected-entities: [PLAYER, VILLAGER]
    # Commands to run after cleanup
    commands:
      - "broadcast Cleanup completed!"

Task Personalization

You can define multiple independent tasks with different intervals and entity filters in the tasks: section.


πŸ› οΈ Practical Example: Clearing items but protecting pets/villagers

πŸ‘€ View Code Example / Cases

Imagine you want X-ClearLag to clear objects from the ground every 5 minutes (300 seconds), but you are afraid it will clear players’ donkeys or dogs, or important villagers that don’t have name tags.

To achieve this, you would use the following configuration ensuring you use protected-entities:.

tasks:
  clearlag:
    enabled: true
    interval: 300 # Runs every 5 minutes
    min-players: 3 # Only works if there are at least 3 people playing
    countdown: [60, 30, 10, 5, 3, 2, 1] # Warns in chat seconds before
    remove-drops: true # Clears items dropped on the floor
    entities: [ARROW, SPECTRAL_ARROW] # Clears arrows to avoid lag
    protected-entities: [PLAYER, VILLAGER, WOLF, CAT, DONKEY] # πŸ›‘οΈ These will NEVER be cleared

With this, your server stays clean and pets and villagers are safe!