
SmartBroadcast
SmartBroadcast is a Paper/Folia 1.20.1 plugin that dynamically controls Minecraft LAN discovery broadcasts using expression-based rules with PlaceholderAPI and MiniMessage support.
- Загрузки
- 5
- Подписчики
- 0
- Обновлён
- 14 июня 2026 г.
- Лицензия
- GPL-3.0-or-later
Опубликован 14 июня 2026 г.
SmartBroadcast
SmartBroadcast is an intelligent Minecraft LAN discovery protocol broadcaster plugin for Paper / Folia 1.20.1. It decides when to broadcast LAN server information, and what MOTD to broadcast, based on configurable expression rules.
Features
- Folia support: uses
GlobalRegionSchedulerandAsyncScheduler, withfolia-supported: trueinplugin.yml - Minecraft LAN discovery protocol support: sends UDP multicast packets to
224.0.2.60:4445 - Multiple rules: rules are checked in order, and the first matching rule is used
- No-broadcast rules: a matched rule can set
broadcast: falseto suppress broadcasting - Expression conditions: player count, whitelist status, port, MOTD, PlaceholderAPI placeholders, and more
- PlaceholderAPI support: PAPI placeholders can be used in both expressions and MOTD values
- MiniMessage support: custom MOTD values can use MiniMessage and will be converted to legacy text
- Current server MOTD support: use
{server_motd}to broadcast the current Paper MOTD - Hot reload support:
/smartbroadcast reload
LAN Discovery Protocol
Minecraft clients listen for UDP multicast packets on 224.0.2.60:4445 while the multiplayer server list screen is open. The server should send a UTF-8 string in this format:
[MOTD]<server MOTD>[/MOTD][AD]<server port>[/AD]
Important: this protocol does not support Adventure rich text components. SmartBroadcast converts MiniMessage or the current server MOTD into legacy § text before broadcasting, so clients can parse it correctly.
Default Behavior
By default, the plugin broadcasts the current server MOTD only when at least one player is online:
rules:
- name: "players-online"
expression: "online > 0"
broadcast: true
motd: "{server_motd}"
If no rule matches, no LAN packet is sent.
Installation
- Build the plugin:
./gradlew shadowJar
- Copy the generated JAR into your server's
pluginsdirectory:
build/libs/SmartBroadcast-1.0.0.jar
- Start your Paper / Folia 1.20.1 server.
- Install PlaceholderAPI as well if you need PlaceholderAPI support.
Commands and Permissions
| Command | Permission | Description |
|---|---|---|
/smartbroadcast reload |
smartbroadcast.admin |
Reloads the configuration |
/sbc reload |
smartbroadcast.admin |
Reloads the configuration |
/lanbroadcast reload |
smartbroadcast.admin |
Reloads the configuration |
Configuration
broadcast:
enabled: true
address: "224.0.2.60"
port: 4445
interval-millis: 1500
advertised-port: -1
enabled: whether broadcasting is enabledaddress: LAN discovery multicast address, defaults to224.0.2.60port: LAN discovery multicast port, defaults to4445interval-millis: broadcast interval; vanilla uses about 1500msadvertised-port: server port advertised to clients;-1means the current server port
Expression Rules
Rules are checked from top to bottom. The first rule whose expression evaluates to true is used.
Boolean Operators
&& and
|| or
! not
Example:
expression: "online > 0 && !whitelist"
Parentheses
expression: "(online > 0 && !whitelist) || %server_tps_1% >= 18"
Comparison Operators
== equals
!= not equals
> greater than
>= greater than or equal
< less than
<= less than or equal
String Operators
contains contains substring
matches regular expression match
Examples:
expression: "motd contains 'Survival'"
expression: "%server_name% matches 'Lobby.*'"
Literals
Supported literals:
truefalse- numbers such as
0and18.5 - strings such as
'Lobby'or"Survival"
Built-in Variables
| Variable | Type | Description |
|---|---|---|
online |
number | Current online player count |
max_players |
number | Maximum player count |
port |
number | Port advertised to clients |
whitelist |
boolean | Whether the whitelist is enabled |
motd |
string | Plain-text form of the current server MOTD |
PlaceholderAPI
When PlaceholderAPI is installed, PAPI placeholders can be used directly in expressions and MOTD values:
expression: "%server_online% > 0"
expression: "%server_tps_1% >= 18"
expression: "%server_name% contains 'Lobby'"
motd: "<green>%server_online%</green><gray>/</gray><yellow>%server_max_players%</yellow>"
MOTD Rendering
Broadcast Current Server MOTD
motd: "{server_motd}"
The plugin reads the current Paper MOTD and converts it to legacy text before broadcasting.
Custom MiniMessage MOTD
motd: "<gradient:#55ff55:#00aaaa>SmartBroadcast</gradient> <gray>|</gray> <yellow>%server_online%</yellow>"
Processing pipeline:
- Apply PlaceholderAPI
- Parse MiniMessage
- Convert to legacy
§text - Send a UDP multicast packet using the LAN discovery protocol
Multiple Rules Example
rules:
- name: "hide-when-whitelist"
expression: "whitelist == true"
broadcast: false
- name: "good-tps"
expression: "online > 0 && %server_tps_1% >= 18"
broadcast: true
motd: "{server_motd}"
- name: "fallback"
expression: "online > 0"
broadcast: true
motd: "<yellow>Server is online</yellow>"
Build Requirements
- Java 17+
- Gradle
- Paper API 1.20.1
Build command:
./gradlew shadowJar
If Gradle Wrapper is not available locally, use an installed Gradle distribution:
gradle shadowJar
Testing Suggestions
- Start the plugin on Folia 1.20.1 and confirm there are no console errors
- Run
/smartbroadcast reloadto test hot reload - Keep at least one player online and refresh the multiplayer server list from a client on the same LAN
- Test whether
broadcast: falsesuppresses broadcasting - Install PlaceholderAPI and test expressions such as
%server_online%and%server_tps_1%
License
This project is licensed under the GNU General Public License v3.0. See LICENSE for details.
Ченджлог
1.0.0Релиз1.20.4, 1.20.5, 1.20.6 · 14 июня 2026 г.
SmartBroadcast v1.0.0
First stable release of SmartBroadcast — an intelligent Minecraft LAN discovery protocol broadcaster for Paper / Folia 1.20.1. It decides when to broadcast LAN server information and what MOTD to broadcast, based on configurable expression rules.
Highlights
- Folia-native scheduling — uses GlobalRegionScheduler and AsyncScheduler;
folia-supported: trueis set inplugin.yml - LAN discovery protocol — sends UTF-8 UDP multicast packets to
224.0.2.60:4445 - Ordered, multi-rule engine — rules are checked top-to-bottom, first match wins
- Optional suppression — a matched rule can set
broadcast: falseto skip the packet - Rich expression conditions — player count, whitelist, port, MOTD, and PlaceholderAPI placeholders
- MiniMessage MOTD — custom MOTDs accept MiniMessage and are converted to legacy
§text before broadcasting - Current server MOTD —
{server_motd}re-broadcasts the live Paper MOTD - Hot reload —
/smartbroadcast reload(aliases:/sbc,/lanbroadcast)
Installation
- Download
SmartBroadcast-1.0.0.jarfrom the assets below. - Drop it into your server's
plugins/directory. - Start the server (Paper or Folia, 1.20.1).
- Install PlaceholderAPI as well if you want PAPI placeholder support.
- (Optional) Tune the generated
plugins/SmartBroadcast/config.yml.
Default behavior
rules:
- name: "players-online"
expression: "online > 0"
broadcast: true
motd: "{server_motd}"
If no rule matches, no LAN packet is sent.
Example: hide on whitelist, normal + TPS fallback
rules:
- name: "hide-when-whitelist"
expression: "whitelist == true"
broadcast: false
- name: "good-tps"
expression: "online > 0 && %server_tps_1% >= 18"
broadcast: true
motd: "{server_motd}"
- name: "fallback"
expression: "online > 0"
broadcast: true
motd: "<yellow>Server is online</yellow>"
Built-in variables
| Variable | Type | Description |
|---|---|---|
online |
number | Current online player count |
max_players |
number | Maximum player count |
port |
number | Port advertised to clients |
whitelist |
boolean | Whether the whitelist is enabled |
motd |
string | Plain-text form of the current server MOTD |
Build from source
Requirements: Java 17+, Gradle (the project includes the Gradle Wrapper).
./gradlew shadowJar
Output JAR: build/libs/SmartBroadcast-1.0.0.jar
License
GNU General Public License v3.0 — see LICENSE.
SmartBroadcast v1.0.0 (中文)
SmartBroadcast 首个稳定版本 —— 一个面向 Paper / Folia 1.20.1 的智能 Minecraft 局域网发现协议广播插件。它根据可配置的表达式规则,决定何时向局域网客户端广播服务端信息,以及广播什么 MOTD。
主要特性
- Folia 原生调度 —— 使用 GlobalRegionScheduler 与 AsyncScheduler,
plugin.yml已声明folia-supported: true - LAN 发现协议 —— 向
224.0.2.60:4445发送 UTF-8 UDP 多播包 - 多规则有序匹配 —— 自上而下检查,首条命中即生效
- 可抑制广播 —— 匹配规则可设置
broadcast: false阻止本次广播 - 丰富的表达式条件 —— 在线人数、白名单、端口、MOTD,以及 PlaceholderAPI 占位符
- MiniMessage MOTD —— 自定义 MOTD 可写 MiniMessage,广播前自动转为 legacy
§文本 - 当前服务端 MOTD ——
{server_motd}直接复用 Paper 当前 MOTD - 热重载 ——
/smartbroadcast reload(别名:/sbc、/lanbroadcast)
安装
- 在下方资源中下载
SmartBroadcast-1.0.0.jar。 - 放入服务端
plugins/目录。 - 启动服务端(Paper 或 Folia,1.20.1)。
- 如需 PAPI 占位符,请同时安装 PlaceholderAPI。
- (可选)按需调整自动生成的
plugins/SmartBroadcast/config.yml。
默认行为
rules:
- name: "players-online"
expression: "online > 0"
broadcast: true
motd: "{server_motd}"
若无规则命中,则不发送 LAN 广播包。
示例:白名单隐藏 + 正常 + TPS 兜底
rules:
- name: "hide-when-whitelist"
expression: "whitelist == true"
broadcast: false
- name: "good-tps"
expression: "online > 0 && %server_tps_1% >= 18"
broadcast: true
motd: "{server_motd}"
- name: "fallback"
expression: "online > 0"
broadcast: true
motd: "<yellow>Server is online</yellow>"
内置变量
| 变量 | 类型 | 说明 |
|---|---|---|
online |
数字 | 当前在线玩家数 |
max_players |
数字 | 最大玩家数 |
port |
数字 | 广播给客户端的端口 |
whitelist |
布尔 | 白名单是否开启 |
motd |
字符串 | 当前服务端 MOTD 的纯文本形式 |
从源码构建
要求: Java 17+、Gradle(项目已包含 Gradle Wrapper)。
./gradlew shadowJar
输出 JAR: build/libs/SmartBroadcast-1.0.0.jar
许可证
GNU 通用公共许可证 v3.0,详见 LICENSE。
Комментарии
Загружаем…