LagReducer
A plugin that will help a server from lagging.
LagReducer
LagReducer — dynamic distances, safe clearing, and smart entity caps for Paper 1.21.8 Keep TPS high without gutting gameplay. LagReducer dynamically lowers a player’s view/simulation distance only while they’re moving fast, periodically clears clutter with safety guards, and caps entity counts per-chunk with precise, configurable rules.
Why use LagReducer? - Smooth performance: Reduce client/server load only when it matters (elytra/flying/vehicles/high speed). - Safe cleanup: Configurable warnings, blacklists, and name exemptions protect valuables and pets. - Hard caps where you need them: Per-chunk totals, categories, and per-type limits with a limiter blacklist.
Features - Dynamic Distance (per-player) - Lowers view and simulation distance while: flying, gliding, in vehicles, or exceeding a speed threshold (blocks/sec). - Auto-restores distances after slowing down (with hysteresis and minimum switch delay). - Honors a bypass permission for staff/testing. - Clear Items & Entities - Automatic timed clearing with broadcast warnings (customizable times). - Category toggles: items, living entities, XP orbs, projectiles, misc. - Blacklists for item materials and entity types. - Optional “exempt named entities” to protect pets and named mobs. - Entity Limiter (per-chunk) - Limits for total, items, living, monsters, animals, ambient. - Per-entity-type caps (e.g., ZOMBIE: 12). - Limiter blacklist: completely ignore certain types (don’t count them and never cancel them). - Ignore selected spawn reasons (e.g., CUSTOM, COMMAND, SPAWNER_EGG). - Debug logging option.
Commands - /lagreducer reload — Reload config and restart features - /lagreducer clear — Run an immediate clear - /lagreducer status — Show feature toggles and clear interval Alias: /lr
Permissions - lagreducer.admin — Use reload/status and admin functions - lagreducer.clear — Allow manual clear command - lagreducer.bypass.distance — Exempt player from dynamic distance changes
Config at a glance - Dynamic distance tuning: - sampleTicks, speedThresholdBps, restoreHysteresisFactor, minSwitchMillis - fastViewDistance, fastSimulationDistance, consider: flying/gliding/vehicles - Clearer safety: - warnAtSeconds, exemptNamedEntities - entityBlacklist, itemBlacklist - Entity limiter controls: - perChunk: total/items/living/monsters/animals/ambient (set -1 to disable a cap) - perType: per-entity-type caps - blacklist: types ignored entirely by the limiter - ignoreSpawnReasons, debug
Example config snippet ```yaml dynamicDistance: enabled: true sampleTicks: 10 speedThresholdBps: 12.0 restoreHysteresisFactor: 0.7 minSwitchMillis: 1500 fastViewDistance: 6 fastSimulationDistance: 4 consider: { flying: true, gliding: true, vehicles: true }
clearer: enabled: true intervalSeconds: 600 warnAtSeconds: [60, 30, 10, 5, 3, 2, 1] exemptNamedEntities: true categories: { items: true, living: true, xpOrbs: true, projectiles: false, misc: false } entityBlacklist: [ARMOR_STAND, ITEM_FRAME, PAINTING] itemBlacklist: [NETHER_STAR, DRAGON_EGG, SHULKER_BOX]
entityLimiter: enabled: true blacklist: [ARMOR_STAND, ITEM_FRAME, PAINTING] perChunk: total: 150 items: 80 living: 100 monsters: 60 animals: 60 ambient: 20 perType: { ZOMBIE: 12 } ignoreSpawnReasons: [CUSTOM, SPAWNER_EGG, COMMAND] debug: false ```
Compatibility and requirements - Server: Paper 1.21.5+ (and compatible forks) - Java: 21 - No NMS, API-only; safe across minor patches. - No external dependencies.
Installation - Drop LagReducer.jar into plugins/ - Start the server to generate config - Edit plugins/LagReducer/config.yml - Use /lagreducer reload to apply changes
Notes - Set any limiter value to -1 to disable that specific cap. - Blacklists protect entities/items from clearing or limiting. - Works alongside most optimization plugins; avoid running multiple “clear lag” plugins at once to prevent conflicts.