Warn (By NightCat)

⭐ — (0 endorsements) 📥 14 downloads 📌 v1.0-SNAPSHOT 📅 7/25/2026
🟡 Updated this year

By nightlight-hk · folia

⬇ Download Mod Source: Modrinth ↗ 📅 Updated: 7/7/2026 📅 Created: 7/25/2026

🔍 Analysis

  • 🏆 #56 of 81 folia mods in this game by downloads

📋 About This Mod

# 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 reload` to apply config changes without restart ## Requirements - **Folia** 1.21.4+ (Paper 26.1+) - Java 21+ ## Installation 1. Download `Warn-1.0-SNAPSHOT.jar` from (https://github.com/nightlight-hk/Warn/releases) 2. Place it in your server's `plugins/` folder 3. Restart the server (or load with a plugin manager) 4. Edit `plugins/Warn/config.yml` to adjust thresholds ## Configuration ```yaml # 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 1. Metric exceeds threshold → timer starts 2. Metric stays above threshold for `duration` seconds → warning triggers 3. Warning cooldown prevents spam for `warning-cooldown` seconds 4. Alarm sound plays to each warned player for the configured duration ## Building ```bash ./gradlew clean jar ``` Output: `build/libs/Warn-1.0-SNAPSHOT.jar` ## License MIT

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 reload` to apply config changes without restart

## Requirements

  • Folia 1. 21. 4+ (Paper 26. 1+)
  • Java 21+

## Installation

1. Download `Warn-1. 0-SNAPSHOT.jar` from (https://github.com/nightlight-hk/Warn/releases) 2. Place it in your server's `plugins/` folder 3. Restart the server (or load with a plugin manager) 4. Edit `plugins/Warn/config.yml` to adjust thresholds

## Configuration

```yaml # 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: "⚠ MSPT is high (ms) in your region!" mspt-warning-op: "⚠ MSPT is high (ms) in region (~ ~)!" cpu-warning: "⚠ CPU usage is high (%) in your region!" cpu-warning-op: "⚠ CPU usage is high (%) in region (~ ~)!" ram-warning: "⚠ Server RAM usage is high (%)!" ```

## 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

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 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.

Standard JVM heap monitoring: `(totalMemory - freeMemory) / maxMemory × 100`. Warnings go to all players since RAM is shared.

### Warning flow

1. Metric exceeds threshold → timer starts 2. Metric stays above threshold for `duration` seconds → warning triggers 3. Warning cooldown prevents spam for `warning-cooldown` seconds 4. Alarm sound plays to each warned player for the configured duration

## Building

```bash ./gradlew clean jar ```

Output: `build/libs/Warn-1. 0-SNAPSHOT.jar`

🤖 AI-enhanced — based on mod data

📊 Mod Details

Game
Minecraft Plugins
Author
nightlight-hk
Version
1.0-SNAPSHOT
Downloads
14
Endorsements
0
Category
folia
Created
7/25/2026
Updated
7/7/2026
Game Versions
1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4
Tags
game-mechanics, optimization

🔧 How to Install Minecraft Plugins Mods

Download from Modrinth. Use Prism Launcher or drop into your mods folder.

📖 Full step-by-step install guide for Minecraft Plugins →

Visit the official mod page for specific installation instructions for this mod.

🎮 Need cheat codes or console commands? Check ur gaming wiki for Minecraft Plugins commands, item IDs, and more.

❓ Frequently Asked Questions

Which Minecraft Plugins versions does Warn (By NightCat) support?

The author lists 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5. Other versions may work but are untested by the author.

What is the latest version of Warn (By NightCat)?

Version 1.0-SNAPSHOT, published 2026-07-07 with 14 downloads recorded at the source.

Keep browsing — more Minecraft Plugins mods await

📋 All Minecraft Plugins Mods 🏆 Top 25 📂 More folia 👤 More by nightlight-hk 🔎 Similar Mods 🌐 Best folia (All Games) 🔀 Check Compatibility ⚖️ Compare Mods 🆕 New Mods