HomeJavaModslaglens
laglens
ModsJava

laglens

by blstmo · on Modrinth

LagLens: Minecraft server plugin that detects lag sources, monitors TPS, and clears problematic entities automatically.

⬇ Download on Modrinth
laglens — screenshot 1laglens — screenshot 2

LagLens Quick Usage Guide

Getting Started

Installation

  1. Drop laglens-1.0.0.jar into your plugins/ folder
  2. Restart your server
  3. LagLens will auto-generate plugins/LagLens/config.yml

First Steps

/laglens

This shows your server's current performance status including TPS, memory usage, and any detected lag sources.

Essential Commands

Performance Overview

/laglens

Shows:

Scan for Lag Sources

/laglens scan

Features:

Teleport to Problematic Chunks

/laglens tp 100 50              # Current world
/laglens tp 100 50 world_nether # Specific world

Clear Boats and Bubble Elevators

/laglens clear boats         # Default radius (64 blocks)
/laglens clear boats 128     # Medium clear radius  
/laglens clear boats 256     # Large clear radius
/laglens clear boats 512     # MASSIVE clear radius

Features:

Clear Minecarts and Rail Systems

/laglens clear minecarts         # Default radius (32 blocks)
/laglens clear minecarts 64      # Medium clear radius
/laglens clear minecarts 128     # Large clear radius  
/laglens clear minecarts 256     # MASSIVE clear radius

Features:

Configuration Management

/laglens reload

Reloads config.yml without restarting the server - perfect for tweaking thresholds on the fly.

Key Configuration Options

Essential Thresholds (config.yml)

thresholds:
  entities:
    warning: 50    # Total entities per chunk
    critical: 100
  mobs:
    warning: 30    # Living entities (excluding players)
    critical: 60
  minecarts:
    warning: 10    # Minecart lag sources
    critical: 25
  boats:
    warning: 15    # Boat entities
    critical: 30
  dropped_items:
    warning: 50    # Items on ground
    critical: 150
  entity_cramming:
    warning: 8     # Entities in same block space
    critical: 15
  minecart_cramming:
    warning: 5     # Minecarts clustered in 3x3x3 area
    critical: 10
  bubble_boats:
    warning: 3     # Boats on bubble columns (scanned in radius!)
    critical: 8
  redstone:
    warning: 40    # Redstone components (MUCH less strict!)
    critical: 100
  hoppers:
    warning: 8     # Hopper count
    critical: 20

Monitoring Frequency

monitoring:
  scan_interval: 20      # Check every 20 ticks (1 second)
  chunks_per_tick: 10    # Scan 10 chunks per tick (prevent scan lag)
  bubble_boat_scan_radius: 1  # Check 1 chunk around each chunk (reduced spam)
  
  # WARNING SPAM PREVENTION
  warning_cooldown: 60        # Wait 1 minute between warnings for same chunk+lagtype
  warn_once_per_chunk: true   # Only warn once per chunk+lagtype until issue is resolved

Clear Boats Settings

clear_boats:
  default_radius: 64        # Default radius for clear command (increased!)
  max_radius: 512          # Maximum allowed radius for massive clearing
  clear_soul_sand: true    # Also remove soul sand when clearing boats
  clear_magma_blocks: true # Also remove magma blocks when clearing boats

# Clear Minecarts Settings
clear_minecarts:
  default_radius: 32        # Default radius for clear command
  max_radius: 256          # Maximum allowed radius for large systems
  clear_rails: false       # Also remove regular rails when clearing minecarts
  clear_powered_rails: false # Also remove powered rails when clearing minecarts
  clear_detector_rails: false # Also remove detector rails when clearing minecarts

Discord Integration

discord:
  enabled: false                    # Enable Discord webhook alerts
  webhook_url: "YOUR_WEBHOOK_URL"   # Discord webhook URL
  send_alerts: true                 # Send lag alerts to Discord
  
  alerts:
    include_server_info: true       # Include TPS/memory in alerts
    ping_role_id: ""               # Role ID to ping for critical alerts
    critical_only: false           # Only send critical alerts
    warning_color: "0xFFA500"      # Warning alert color (orange)
    critical_color: "0xFF0000"     # Critical alert color (red)

Common Use Cases

Daily Health Check

/laglens

Quick status check - green TPS means you're good!

Investigating Player Reports

/laglens scan

When players report lag, scan to see what chunks are problematic, then click [TELEPORT] to investigate instantly!

Proactive Maintenance

Set conservative thresholds to catch problems before they impact TPS:

entities:
  warning: 30    # Lower threshold = earlier detection

Clearing Minecart Cramming

When you get minecart cramming warnings:

/laglens scan                    # Identify the problem chunk
[Click TELEPORT] or /laglens tp  # Go to the problematic chunk
/laglens clear minecarts 64      # Clear crammed minecarts

Advanced Options:

Tuning for Your Server

Understanding Warning Types

Warning Spam Prevention

LagLens now includes intelligent warning spam prevention:

Clear Boats Command

Usage: /laglens clear boats [radius]

Perfect for:

Discord Integration

LagLens supports Discord webhook alerts for real-time lag notifications.

Features:

Setup:

  1. Create a Discord webhook in your server channel
  2. Copy the webhook URL
  3. Set discord.enabled: true in config.yml
  4. Paste your webhook URL in discord.webhook_url
  5. Configure alert settings as needed

Example Discord Alert:

CRITICAL Lag Source Detected
Location: World: world, Chunk: 30, -13
Issue Type: Entity Cramming (Minecart Cramming)
Severity: 12 (limit: 5)
Details: Minecart Cramming: 12 minecarts clustered in 3x3x3 area
URGENT: Clear Minecart Cramming!
/laglens tp 30 -13 world
Then use clear command:
/laglens clear minecarts 64
Or for larger radius:
/laglens clear minecarts 128
Or kill manually:
/kill @e[type=minecart,distance=..16]
/kill @e[type=chest_minecart,distance=..16]
/kill @e[type=hopper_minecart,distance=..16]

12 minecarts crammed - Fix ASAP!
Server Status: TPS: 16.8, Players: 8, Memory: 72%

Entity Cramming Warnings

Minecart Warnings

Minecart Cramming Warnings

Boat Warnings

Bubble Boat Warnings

Dropped Item Warnings

Mob Warnings

Redstone Warnings (Less Strict Now)

Clickable Warnings

When lag warnings appear in chat, admins can now click [TELEPORT] to instantly jump to the problematic chunk! No more copying coordinates manually.

Example warning:

[LagLens] Chunk 100, 50 has 120 entities (limit: 100) [TELEPORT]
                                                        ↑ Click this!

Pro Tips

  1. Click the [TELEPORT] links - Instant investigation!
  2. Use /laglens scan regularly - Don't wait for lag to investigate
  3. Use /laglens clear boats 512 for massive issues - Nuclear option for huge boat problems
  4. Set up Discord alerts - Get notified instantly when lag sources appear
  5. Warnings won't spam anymore - Each chunk only warns once until fixed
  6. Entity cramming detection - Catches mob farm issues early
  7. Bubble boat detection - Finds stuck boat elevators automatically
  8. Monitor during peak hours - Most lag happens when server is busiest
  9. Redstone is less strict now - Fewer false positives from normal builds

Permissions for Staff

# Basic moderator - can check and scan
laglens.use: true
laglens.scan: true

# Advanced moderator - can also clear entities
laglens.clear: true  # Clear boats and minecarts

# Admin - full access including teleport and config
laglens.admin: true  # Gets clickable teleport warnings
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more