Compatibility
Minecraft: Java Edition
Platforms
Links
Tags
Creators
Details
Warn
A Folia ONLY region-aware performance warning plugin. Monitors MSPT, CPU, and RAM per region and warns players when thresholds are exceeded.
Features
- Per-region MSPT monitoring โ warns only players in the affected region
- Per-region CPU monitoring โ measures actual thread CPU time per Folia region
- Server-wide RAM monitoring โ warns all players
- OP notifications โ operators receive all warnings plus region coordinates
- Configurable thresholds and durations โ all via
config.yml - Alarm sound โ plays a configurable sound to warned players
- Reloadable โ
/warn reloadto apply config changes without restart
Requirements
- Folia 1.21.4+ (Paper 26.1+)
- Java 21+
Installation
- Download
Warn-1.0-SNAPSHOT.jarfrom Releases - Place it in your server's
plugins/folder - Restart the server (or load with a plugin manager)
- Edit
plugins/Warn/config.ymlto adjust thresholds
Configuration
# MSPT monitoring (milliseconds per tick)
mspt:
enabled: true
threshold: 45.0 # warn when MSPT exceeds this
duration: 10 # must exceed threshold for this many seconds
# CPU monitoring (percentage 0-100+)
cpu:
enabled: true
threshold: 90.0
duration: 10
# RAM monitoring (percentage 0-100)
ram:
enabled: true
threshold: 90.0
duration: 10
# General
check-interval: 1 # seconds between checks
warning-cooldown: 15 # seconds between warnings (anti-spam)
# Alarm sound
alarm:
enabled: true
sound: "BLOCK_NOTE_BLOCK_PLING"
volume: 1.0
pitch: 1.0
duration: 3 # seconds to repeat
interval: 2 # ticks between plays (2 = 10/sec)
# Messages (MiniMessage format)
messages:
mspt-warning: "<red>โ MSPT is high (<mspt>ms) in your region!</red>"
mspt-warning-op: "<red>โ MSPT is high (<mspt>ms) in region <region> (~<x> ~<z>)!</red>"
cpu-warning: "<red>โ CPU usage is high (<cpu>%) in your region!</red>"
cpu-warning-op: "<red>โ CPU usage is high (<cpu>%) in region <region> (~<x> ~<z>)!</red>"
ram-warning: "<red>โ Server RAM usage is high (<ram>%)!</red>"
Commands
| Command | Permission | Description |
|---|---|---|
/warn reload |
warn.admin |
Reload config.yml |
Permissions
| Permission | Default | Description |
|---|---|---|
warn.admin |
op | Allows /warn reload |
warn.notify |
op | Receive all warnings + region coordinates (OP-level notifications) |
How it works
MSPT
Every check interval, a task is scheduled on each player's Folia region via RegionScheduler.execute(). The scheduling delay approximates the region's MSPT. Players are grouped by region, and if a region exceeds the MSPT threshold for the configured duration, only players in that region receive a warning.
Operators receive all MSPT warnings regardless of region, with the lagging region's approximate block coordinates.
CPU
CPU utilization is measured independently from MSPT using ThreadMXBean.getCurrentThreadCpuTime(). Each region's tick thread records its cumulative CPU time. The delta between consecutive measurements divided by wall-clock time gives actual per-thread CPU usage โ not derived from MSPT.
RAM
Standard JVM heap monitoring: (totalMemory - freeMemory) / maxMemory ร 100. Warnings go to all players since RAM is shared.
Warning flow
- Metric exceeds threshold โ timer starts
- Metric stays above threshold for
durationseconds โ warning triggers - Warning cooldown prevents spam for
warning-cooldownseconds - Alarm sound plays to each warned player for the configured duration
Building
./gradlew clean jar
Output: build/libs/Warn-1.0-SNAPSHOT.jar
License
MIT


