LandsLimitEnforcer
The Problem
The Lands plugin enforces chunk and land limits at claim time but it does nothing when a player's limits are reduced after the fact.Common scenario: A player purchases a Premium rank, claims 10 lands and 2000 chunks, then their rank expires. Lands quietly lets them keep everything now permanently over their default limits with no way to enforce it automatically.
Features
Three-Phase Enforcement
Enforcement runs in three sequential phases each independent, each precise:- Phase 1 Land Count: If the player owns more lands than their limit allows, the excess lands are fully deleted (oldest or smallest first your choice).
- Phase 2 Per-Land Size: If any single land exceeds the player's land size limit, excess chunks are unclaimed from that land.
- Phase 3 Total Chunks: If the player's combined chunk count across all lands exceeds their total chunk limit, excess chunks are removed accounting for what Phase 2 already unclaimed to prevent over-removal.
Smart Detection Works With Any Permission Plugin
- Login trigger: Checks every player on join. Covers rank expirations that happened while offline.
- Universal monitor: Periodically checks all online players on a configurable interval. Works with LuckPerms, PermissionsEx, UltraPermissions, GroupManager any permission plugin that uses Bukkit's permission layer.
- LuckPerms live hook (optional): When LuckPerms is installed, enforcement fires within ~2 seconds of a group or permission change no waiting for the next monitor cycle.
Safe & Precise
- Pre-check before every enforcement run if no violations exist, the plugin exits silently. No messages, no log spam for normal players.
- Deduplication prevents multiple simultaneous enforcement tasks for the same player.
- Configurable millisecond delays between land deletions and chunk unclaims to prevent server lag spikes.
- Phase 2 and Phase 3 are coordinated Phase 3 always accounts for what Phase 2 removed so chunks are never double-unclaimed.
- Only owned lands are ever touched lands a player is merely trusted in are completely ignored.
Configurable Removal Order
- Land removal:
newest_first·smallest_first·largest_first - Chunk removal:
newest_first·oldest_first·random
Player Notifications
- Fully customizable messages with
{land}and{count}placeholders. - Notification only sent when enforcement actually happens — players within limits never see a message.
- Supports
&color codes.
Detailed Logging
- Persistent log file at
plugins/LandsLimitEnforcer/logs/enforcement.log. - Every land deletion and chunk unclaim is recorded with timestamp, player, and land name.
- Per-chunk logging can be toggled off for large servers to reduce verbosity.
Whitelist & OP Exemption
- OPs are always exempt — hardcoded, no configuration needed.
- Additional players can be whitelisted by name or UUID in
config.yml.
Admin Commands
/lle check <player>— Force-run enforcement on any online player instantly./lle reload— Reload config without restarting./lle status— Show online player count and active enforcements.
landsenforcer.admin (default: OP). Full tab-complete support.
Configuration Overview
Code:
whitelist:
# - ExamplePlayer
# - another-player
# - 7e36f175-ea82-3251-80b3-e677f43ebe7f
# --- Triggers ---
# These control when enforcement checks are run.
triggers:
# Check every player on login (covers offline premium expirations).
# Works with any permission plugin.
on-login: true
# Universal limit monitor — works with ANY permission plugin (LuckPerms, PermissionsEx,
# UltraPermissions, GroupManager, etc.). Runs a lightweight in-memory check for all
# online players every N seconds. If a violation is found, enforcement is scheduled.
# This is the primary detection mechanism when LuckPerms is not installed.
# Set to 0 to disable.
monitor-interval-seconds: 120
# (Optional) LuckPerms-specific event hook. When LuckPerms is installed this fires
# instantly the moment a permission/group changes, reducing detection lag from
# monitor-interval-seconds down to enforcement-delay-ticks.
# Has no effect if LuckPerms is not installed.
luckperms-events: true
# Delay in server ticks AFTER a LuckPerms event before enforcement runs.
# This gives Lands time to recalculate its own internal limit_pack first.
# 40 ticks = 2 seconds. Increase if you notice race conditions.
enforcement-delay-ticks: 40
# --- Rate Limiting ---
# Space out bulk operations to prevent lag spikes.
rate-limiting:
# Milliseconds to wait between deleting each excess land
land-delete-delay-ms: 150
# Milliseconds to wait between unclaiming each excess chunk
chunk-unclaim-delay-ms: 25
# --- Removal Priority ---
# Which lands to remove first when player exceeds their land count limit.
# Options: newest_first | smallest_first | largest_first
land-removal-order: newest_first
# Which chunks to unclaim first when enforcing land-size or total-chunk limits.
# Options: newest_first | oldest_first | random
chunk-removal-order: newest_first
# --- Player Notifications ---
notifications:
enabled: true
# Sent once at the start of enforcement so the player knows what's happening
enforcement-start: "&eYour land claims are being adjusted to match your current limits."
# Sent each time a land is fully deleted
land-deleted: "&cYour land '&e{land}&c' was removed because your land limit changed."
# Sent per-land when chunks are unclaimed from it
chunks-removed: "&c{count} chunk(s) were unclaimed from '&e{land}&c' because your chunk limit changed."
# --- Logging ---
logging:
enabled: true
# Path relative to the plugin's data folder (plugins/LandsLimitEnforcer/)
file: logs/enforcement.log
# Log every individual chunk unclaim operation (can be verbose for large removals)
log-chunk-unclaims: true
Important Note
This plugin reads limit values from Lands' internal limit pack cache. For enforcement to be accurate, Lands must have recalculated the player's limits after their group changed. This happens automatically on player login. If you need to force a recalculation for online players, run /lands admin limits refresh.Not affiliated with the Lands plugin or its developer. This is an independent community add-on.
