Limiter
Docs/Limiter

Limiter

Lag prevention for Paper and Folia: cap entities, dropped items and placed blocks per chunk, slow fast redstone, guard against dispenser, fluid and falling block lag, and find the heaviest chunks, with live in-game editing.

Requirements

  • Paper or Folia 1.21+ (Folia is supported)
  • Java 21
  • Dialog screens need Paper 1.21.6 or newer. On older builds, set gui.dialog-input-enabled: false to use the chest GUI.

Installation

  1. Drop Limiter.jar into plugins/.
  2. Start the server once to generate config.yml, limits.yml, messages.yml and the gui/ menu files.
  3. Edit the limits in limits.yml (or use /limiter gui) and run /limiter reload.
  4. Run /limiter status to check that everything is working.

No other plugins are required.

When you update, Limiter adds new settings to your files and keeps your values. If a file changed, a .new file next to it (for example config.yml.new) lists what was added or changed, and config.yml.old is your file from before a config update. A file that cannot be read is saved as .broken and replaced with the default. Limits that older versions kept inside config.yml are moved to limits.yml automatically.

Commands

Base command: /limiter (alias /lim). Everything needs limiter.admin.

Command What it does
/limiter or /limiter gui Open the admin dashboard (players). Prints help from console.
/limiter help Show the help text.
/limiter status Show what is working: redstone limiter, lag guards, limit categories and the last lag scan.
/limiter check List every active entity, block and item limit.
/limiter reload Reload config.yml, limits.yml, messages.yml and the menus.
/limiter settings [group] Browse and change every config.yml setting in a menu (players). A group is a top-level section of config.yml.
/limiter explain <setting> Show what a setting does, its current value and its default.
/limiter set <setting> <value> Change any config.yml setting by its path, for example redstone-limiter.action slow. Lists take comma separated values, or none to empty them. Reloads after saving.
/limiter set entity <TYPE|GROUP> <limit> Set an entity or group limit.
/limiter set block <MATERIAL> <limit> Set a per-chunk block limit.
/limiter set item <MATERIAL> <limit> Set a per-chunk dropped-item limit.
/limiter remove <entity|block|item> <key> Remove a limit (alias del).
/limiter toggle <entity|block|item|redstone> Turn a whole category on or off.
/limiter redstone pulse <ticks> Pulses shorter than this count as 1-tick redstone.
/limiter redstone strikes <count> Too-fast pulses allowed in a chunk before it is paused.
/limiter redstone window <seconds> How long too-fast pulses keep counting toward the strikes.
/limiter redstone release <seconds> How long a chunk caught making too-fast pulses stays paused.
/limiter redstone chunk <per-second> Most activations per chunk each second. 0 = off.
/limiter redstone chunkpause <seconds> How long a chunk stays paused after going over the cap.
/limiter redstone action <slow|pause|monitor> What happens to a chunk that is over the cap.
/limiter redstone escalate <seconds> Pause a chunk that stays over the cap this long (slow only). 0 = never.
/limiter redstone resume <ticks> Delay before a slowed redstone torch is checked again. 0 = off.
/limiter redstone piston <weight> How much a piston extension adds to the chunk count. 0 = pistons not counted.
/limiter redstone hot [count] List the busiest redstone chunks (up to 25) with their rate and state.
/limiter redstone break Toggle breaking the part that made a too-fast pulse.
/limiter redstone alert Toggle staff chat alerts.
/limiter redstone exempt <world> Add or remove a world from the redstone exempt list.
/limiter guards Show each lag guard, its cap, and how much it blocked.
/limiter guards <dispensers|fluids|falling> Turn that guard on or off.
/limiter guards <dispensers|fluids|falling> <max> Set the guard's cap per chunk each second.
/limiter guards action <slow|monitor> Block over-cap activity, or only count and alert.
/limiter guards alert Toggle lag guard staff alerts.
/limiter lagscan [run] Scan every loaded chunk and show the results (players get a menu, the console gets a list).
/limiter lagscan top [count] List the heaviest chunks.
/limiter lagscan tp <rank> Teleport to a scan result (players).
/limiter lagscan toggle Turn the lag scan on or off.
/limiter lagscan threshold <metric> <count> Set when a chunk counts as heavy. Metrics: entities, mobs, items, tile-entities, hoppers.
/limiter worlds [world] Entity counts for every world, or one world and its entity types.
/limiter entities [world] [type] Entity counts per type and where the busiest chunk is.

Examples:

/limiter set entity ANIMALS 30
/limiter set entity COW 10
/limiter set block HOPPER 64
/limiter set item TNT 50
/limiter toggle redstone
/limiter set redstone-limiter.max-activations-per-chunk 800
/limiter explain lag-guards.fluids.max-per-chunk
/limiter lagscan top 5

Every limit is counted per chunk (one 16x16 area), not per player. Entity keys are a Paper entity type (ZOMBIE) or a group: ANIMALS, MONSTERS, MINECARTS, BOATS, PROJECTILES. Groups are defined under entity-groups in limits.yml, where you can edit them or add your own. A specific type overrides its group. Block and item keys are Bukkit material names. In the commands, placeable blocks go under block and everything else under item. To limit a dropped block such as sand, list it under item-limits in limits.yml (the defaults already do). Limit commands save to limits.yml and apply immediately. The limit value in a command must be 1 or higher. Remove a limit to lift it.

Permissions

Permission Default Description
limiter.admin op All commands, the menus, and redstone and lag guard staff alerts. The node can be renamed with permissions.admin in config.yml.

Configuration

Files: config.yml (settings), limits.yml (every entity, item and block limit, plus entity-groups), messages.yml (all text), and gui/*.yml (menu layouts). Messages and menus use &#RRGGBB colours and the tokens {accent}, {success}, {error}, {warning}, {muted}, {separator}, {info} and {white}, which come from accent-color and colors in config.yml. Run /limiter reload after editing. You can also change any config.yml setting in game with /limiter settings or /limiter set <setting> <value>, and read about it with /limiter explain <setting>.

config.yml

Key Default Meaning
debug false Verbose console logging.
accent-color &#00D4FF Main colour, available as {accent}.
colors.* see file Shared palette: success, error, warning, muted, separator, info, white.
radius 16 Players within this many blocks of a blocked spawn, breed or item drop get the limit message. Limits themselves are per chunk.
sweep-chunk-radius 2 Chunks around each online player that are swept for extra entities and items. 2 is a 5x5 square.
update-rate 20 Ticks between background entity and item sweeps.
exempt-worlds [world_the_end] Worlds ignored by entity, item and block limits and by the lag guards.
master-toggles.entity-limits true Enforce entity limits.
master-toggles.block-limits true Enforce block limits.
master-toggles.item-limits true Enforce item limits.
master-toggles.redstone-limiter true Enforce the redstone limiter.
features.entity-spawn-block true Cancel entity spawns that would go over a limit.
features.entity-breed-block true Cancel breeding that would go over a limit.
features.entity-sweep true Remove entities that are over a limit.
features.item-drop-block true Cancel player drops that would go over a limit.
features.item-spawn-trim true Remove the oldest dropped items when a new item spawn goes over a limit.
features.item-sweep true Remove dropped items that are over a limit.
features.block-place-block true Cancel block placements that would go over a chunk limit.
timing.entity-sweep-delay-ticks 20 Ticks before the first entity sweep after startup or reload.
timing.item-sweep-delay-ticks 40 Ticks before the first item sweep.
timing.item-sweep-min-period-ticks 40 The item sweep never runs more often than this.
timing.redstone-reset-period-ticks 20 How often the redstone and lag guard counters reset.
timing.pending-drop-ticks 2 Ticks a just-dropped item still counts toward the item limit.
timing.break-delay-ticks 1 Ticks before a blocked redstone part is broken (needs break-blocked-parts).
timing.config-save-delay-ms 500 Delay before menu changes are written to disk.
timing.block-recount-cooldown-seconds 5 A chunk's block count is re-checked at most this often.
timing.full-sweep-every-cycles 5 Sweeps check every nearby chunk once per this many sweeps. In between they only check chunks where a limited entity or item just appeared. 1 = every chunk every sweep.
cooldowns.notification-ms 4000 Delay before the same limit warning reaches the same player again.
permissions.admin limiter.admin Permission node for everything.
redstone-limiter.action slow What happens to a chunk whose redstone runs too fast: slow, pause or monitor.
redstone-limiter.min-pulse-ticks 2 ON pulses shorter than this are 1-tick redstone.
redstone-limiter.strikes 3 Too-fast pulses in one chunk before all redstone in it is paused.
redstone-limiter.strike-window-seconds 30 Too-fast pulses older than this stop counting toward the strikes.
redstone-limiter.release-after-seconds 60 How long a chunk caught making too-fast pulses stays paused.
redstone-limiter.break-blocked-parts false Also break the part that made a too-fast pulse (it drops as an item).
redstone-limiter.max-activations-per-chunk 1200 Most redstone switch-ons per chunk each second. 0 = off.
redstone-limiter.chunk-pause-seconds 5 Pause length after a chunk goes over the cap (pause, or after slow escalates).
redstone-limiter.piston-weight 4 Each piston extension adds this many activations, plus 1 per block pushed. 0 = pistons not counted.
redstone-limiter.slow.escalate-after-seconds 10 With slow, a chunk that stays over the cap this long is paused. 0 = never.
redstone-limiter.slow.resume-torch-delay-ticks 10 A slowed redstone torch is checked again after this many ticks. 0 = off.
redstone-limiter.alert.enabled true Alert online staff when something is blocked.
redstone-limiter.alert.cooldown-ms 3000 Minimum delay between alerts for the same chunk.
redstone-limiter.worlds-blacklist [] Worlds the redstone limiter ignores.
lag-guards.action slow slow blocks activity over each cap, monitor only counts and alerts.
lag-guards.alert true Alert staff when a guard starts blocking in a chunk.
lag-guards.alert-cooldown-ms 5000 Minimum delay between alerts for the same chunk and guard.
lag-guards.dispensers.enabled / max-per-chunk true / 400 Dispenser and dropper shots per chunk each second. A blocked one keeps its item.
lag-guards.fluids.enabled / max-per-chunk true / 3000 Water and lava spread steps per chunk each second.
lag-guards.falling-blocks.enabled / max-per-chunk true / 200 Blocks that start falling per chunk each second. Blocks already falling are never touched.
lag-scan.enabled true Allow /limiter lagscan.
lag-scan.cooldown-seconds 10 Seconds before a new scan can run. Asking sooner shows the last result.
lag-scan.timeout-seconds 15 A scan still running after this long reports what it has.
lag-scan.max-chunks 20000 Most chunks read in one scan.
lag-scan.max-results 25 Chunks kept in the result, highest score first.
lag-scan.min-score 1.0 Chunks scoring less than this are not listed.
lag-scan.limit-pressure 0.8 How close to a limit or cap counts as heavy (0.8 = 80 percent).
lag-scan.metrics.<metric>.threshold / weight see below A chunk is heavy for a metric at the threshold. The weight sets how much it adds to the score.
lag-scan.weights.entity-limits / redstone / guards 1.0 / 2.0 / 1.5 Score weight for chunks near an entity limit, the redstone cap or a guard cap.
gui.dialog-input-enabled true Use Paper dialogs (exact value entry) instead of the chest GUI.
gui.live-ram-refresh-ticks 20 Refresh rate of the live RAM monitor.
stats.gui-top / stats.dialog-top 18 / 15 Entity types listed in the chest menu and in the dialog statistics screen.
history.max-flags 100 Recent item-limit triggers remembered for the flag log.
ram.warning-percent / ram.critical-percent 60 / 85 RAM monitor colour thresholds.
toggle-aliases.* see file Short names for /limiter toggle (entity, block, item, redstone).

The lag scan metrics and their defaults (threshold / weight) are entities (80 / 1.0), mobs (50 / 1.5), items (100 / 1.0), tile-entities (150 / 1.0) and hoppers (40 / 2.0).

The rest of config.yml only changes how things look or feel and can be left alone: style (menu item title and hover text), formats, progress-bar, sounds, dialogs (dialog layout), ranges (limits for the dialog number inputs), tab-completion (suggested values) and license-key. config-version is used for updates, do not change it.

limits.yml

Section Meaning
entity-groups.<GROUP> Entity types in a group. Defaults: ANIMALS, MONSTERS, MINECARTS, BOATS, PROJECTILES. Unknown types are ignored with one warning.
entity-limits.<TYPE or GROUP> Most of that type or group in one chunk.
item-limits.<MATERIAL> Most dropped items of a material lying in one chunk.
block-limits.<MATERIAL> Most placed blocks of a material in one chunk.

The file ships with defaults for common problem entities, items and blocks (for example ANIMALS: 50, MONSTERS: 62, HOPPER: 128). Set a limit to 0, or remove the key, for no limit. For no limits at all in a section write {} after its name, for example item-limits: {}. A section that is deleted or left empty gets the defaults back. Your own groups, types and materials are never overwritten by updates.

How limits are enforced

Category Behaviour
Entities Counted per chunk. Spawns and breeding are blocked at the cap. Excess entities in the chunks around players (sweep-chunk-radius) are removed, newest first. Named, tamed and leashed entities are never removed.
Items Counted per chunk. Player drops over the cap are blocked. When an item spawns over the cap, the oldest matching items in the chunk are removed to make room, and sweeps trim the rest.
Blocks Counted per chunk. Placement over the cap is cancelled. Counts are cached and re-checked at most every timing.block-recount-cooldown-seconds, and dropped on reload and when a chunk unloads.
Redstone Only stops parts from switching ON, so circuits never get stuck powered. A chunk over max-activations-per-chunk is handled by action: slow blocks only the extra switch-ons (and pauses the chunk if it stays over for slow.escalate-after-seconds), pause pauses the whole chunk, monitor only alerts. A chunk that keeps making 1-tick pulses is paused for release-after-seconds. Pistons count toward the cap through piston-weight. Normal farms and fast clocks are unaffected.
Lag guards Dispensers and droppers, flowing water and lava, and blocks starting to fall are counted per chunk each second. Over its cap, a guard blocks the extra activity (slow) or only counts and alerts (monitor). Nothing is forced on or off, so nothing gets stuck.
Lag scan /limiter lagscan reads every loaded chunk, scores it against the lag-scan thresholds and your own limits, and lists the heaviest chunks with their causes. /limiter worlds and /limiter entities use the latest scan.

Warnings go to chat and the action bar using the templates in messages.yml. Staff with the admin permission also get chat alerts when the redstone limiter or a lag guard blocks something (redstone-limiter.alert, lag-guards.alert).

Integrations

None. No soft-dependencies and no PlaceholderAPI expansion.

Developer API

Limiter has no public API and fires no custom events.

FAQ

Why was a named or tamed mob not removed? Named, tamed and leashed entities are skipped by the sweep. They still count toward the total.

A limit set to 0 does nothing. Is that a bug? No. 0 or a missing key means unlimited, and the limit commands only accept 1 or higher. To nearly block something, set it to 1.

Will the redstone limiter break my farms? Normally no. Repeaters, observers, the fastest legitimate clocks and normal farms never pulse under 2 ticks, so leave min-pulse-ticks at 2. The speed cap (max-activations-per-chunk, 1200 per second by default) only slows chunks far busier than a normal farm. If a big farm is slowed, raise the cap, check it with /limiter redstone hot, or set redstone-limiter.action to monitor to only watch.

How do I try the limiter without blocking anything? Set redstone-limiter.action and lag-guards.action to monitor, then watch /limiter status, /limiter redstone hot and /limiter guards. Switch to slow when the numbers look fair.

How do I find what is lagging my server? Run /limiter lagscan. It lists the heaviest chunks and what is in them, and /limiter lagscan tp <rank> takes you there.

Dialogs do not open. Dialogs need Paper 1.21.6+. Set gui.dialog-input-enabled: false to use the chest GUI.