MacroModServer:通用伴侣服务器插件
MacroModServer 是 MacroMod 的官方服务端伴侣插件。它为服务器管理员提供了针对运行 MacroMod Fabric 客户端模组的玩家的细粒度策略控制、速率限制以及权限管理。
? 支持的服务器平台
MacroModServer 被编译为多平台伴侣插件,支持:
- Paper / Folia / Purpur / Spigot (1.20+)
- Velocity Proxy (3.x & 4.x)
- BungeeCord / Waterfall Proxy
⚙️ 工作原理
当玩家登录(或执行 /macromod reload)时,MacroModServer 会通过自定义插件消息通道 macromod:policy 发送 JSON 格式的策略负载。
当 MacroMod 客户端连接时:
- 客户端接收
macromod:policy 负载。
- 客户端自动强制执行服务器的策略规则(例如禁用移动宏、限制循环迭代次数或施加聊天速率限制)。
- 如果未安装服务器插件,客户端将遵循其本地设置或“服务器安全模式”配置。
? 配置 (config.yml)
插件在首次启动时会生成一个 config.yml 文件:
version: 1
# 通用宏功能
allowMovement: true # 允许 WASD / 移动自动化
allowLook: true # 允许视角转向自动化 ({LOOK}, {LOOKAT})
allowInventoryAutomation: true # 允许容器/物品栏槽位点击及存取
allowScriptFiles: true # 允许运行多行 .mcm 脚本文件
allowLooping: true # 允许脚本中的 while/for 循环
maxLoopIterations: 0 # 允许的最大循环迭代次数 (0 = 无限制)
# 速率限制(毫秒)
chatRateLimitMs: 0 # 聊天消息之间的最小延迟 (0 = 禁用)
commandRateLimitMs: 0 # 命令执行之间的最小延迟 (0 = 禁用)
# 事件触发器总开关
allowEventTriggers: true # 所有客户端事件触发器的总开关
# 细粒度事件触发器开关
allowTriggerChat: true
allowTriggerJoinServer: true
allowTriggerDeath: true
allowTriggerRespawn: true
allowTriggerDimensionChange: true
allowTriggerContainerOpen: true
allowTriggerContainerClose: true
allowTriggerTakeDamage: true
allowTriggerLowHealth: true
allowTriggerLowHunger: true
allowTriggerInventoryFull: true
allowTriggerLowDurability: true
allowTriggerLowArmor: true
allowTriggerLowAir: true
allowTriggerLowXp: true
? LuckPerms 集成(按组/按玩家覆盖)
如果您的服务器上安装了 LuckPerms,MacroModServer 会自动检查 LuckPerms 元数据节点。元数据值将在按玩家或按组的基础上覆盖全局 config.yml 设置!
支持的 LuckPerms 元数据键:
macromod.allowMovement (true/false)
macromod.allowLook (true/false)
macromod.allowInventoryAutomation (true/false)
macromod.allowScriptFiles (true/false)
macromod.allowLooping (true/false)
macromod.maxLoopIterations (整数,例如 100)
macromod.chatRateLimitMs (整数毫秒,例如 1000)
macromod.commandRateLimitMs (整数毫秒,例如 500)
macromod.allowEventTriggers (true/false)
示例命令:
# 禁用默认玩家的移动自动化
/lp group default meta set macromod.allowMovement false
# 对默认玩家实施 2 秒的聊天速率限制
/lp group default meta set macromod.chatRateLimitMs 2000
# 允许 VIP 组完整执行脚本
/lp group vip meta set macromod.allowScriptFiles true
/lp group vip meta set macromod.allowMovement true
? 命令与权限
| 命令 |
权限 |
描述 |
/macromod reload |
macromod.admin (或 OP) |
重新加载 config.yml 并向所有在线客户端推送更新后的策略负载。 |
?️ 从源代码编译
要编译 macromod-server 插件 JAR:
# 从根仓库目录
./gradlew :macromod-server:build
编译后的插件 JAR 将创建在 macromod-server/common/build/libs/ 中,预构建的二进制文件可在 release/macromod-server-*.jar 下找到。
MacroModServer: Universal Companion Server Plugin
MacroModServer is the official server-side companion plugin for MacroMod.It provides server administrators with granular policy controls, rate limiting, and permission management for players running the MacroMod Fabric client mod.
? Supported Server Platforms
MacroModServer is compiled as a multi-platform companion plugin supporting:
- Paper / Folia / Purpur / Spigot (1.20+)
- Velocity Proxy (3.x & 4.x)
- BungeeCord / Waterfall Proxy
⚙️ How It Works
Upon player login (or when /macromod reload is executed), MacroModServer sends a JSON policy payload over the custom plugin messaging channel macromod:policy.
When a MacroMod client connects:
- The client receives the
macromod:policy payload.
- The client automatically enforces the server's policy rules (e.g. disabling movement macros, capping loop iterations, or imposing chat rate limits).
- If no server plugin is present, the client follows its local settings or Server-Safe Mode configuration.
? Configuration (config.yml)
The plugin generates a config.yml file on first startup:
version: 1
# General Macro Features
allowMovement: true # Allow WASD / movement automation
allowLook: true # Allow camera turning automation ({LOOK}, {LOOKAT})
allowInventoryAutomation: true # Allow container/inventory slot clicks and stashing
allowScriptFiles: true # Allow running multi-line .mcm script files
allowLooping: true # Allow while/for loops in scripts
maxLoopIterations: 0 # Max loop iterations allowed (0 = unlimited)
# Rate Limits (in milliseconds)
chatRateLimitMs: 0 # Minimum delay between chat messages (0 = disabled)
commandRateLimitMs: 0 # Minimum delay between command executions (0 = disabled)
# Event Trigger Master Toggle
allowEventTriggers: true # Master switch for all client event triggers
# Granular Event Trigger Toggles
allowTriggerChat: true
allowTriggerJoinServer: true
allowTriggerDeath: true
allowTriggerRespawn: true
allowTriggerDimensionChange: true
allowTriggerContainerOpen: true
allowTriggerContainerClose: true
allowTriggerTakeDamage: true
allowTriggerLowHealth: true
allowTriggerLowHunger: true
allowTriggerInventoryFull: true
allowTriggerLowDurability: true
allowTriggerLowArmor: true
allowTriggerLowAir: true
allowTriggerLowXp: true
? LuckPerms Integration (Per-Group / Per-Player Overrides)
If LuckPerms is installed on your server, MacroModServer automatically checks for LuckPerms metadata nodes. Metadata values override global config.yml settings on a per-player or per-group basis!
Supported LuckPerms Meta Keys:
macromod.allowMovement (true/false)
macromod.allowLook (true/false)
macromod.allowInventoryAutomation (true/false)
macromod.allowScriptFiles (true/false)
macromod.allowLooping (true/false)
macromod.maxLoopIterations (integer, e.g. 100)
macromod.chatRateLimitMs (integer ms, e.g. 1000)
macromod.commandRateLimitMs (integer ms, e.g. 500)
macromod.allowEventTriggers (true/false)
Example Commands:
# Disable movement automation for default players
/lp group default meta set macromod.allowMovement false
# Enforce a 2-second chat rate limit for default players
/lp group default meta set macromod.chatRateLimitMs 2000
# Allow full script execution for VIP group
/lp group vip meta set macromod.allowScriptFiles true
/lp group vip meta set macromod.allowMovement true
? Commands & Permissions
| Command |
Permission |
Description |
/macromod reload |
macromod.admin (or OP) |
Reloads config.yml and pushes updated policy payloads to all online clients. |
?️ Compiling from Source
To compile the macromod-server plugin JAR:
# From the root repository directory
./gradlew :macromod-server:build
The compiled plugin JAR will be created in macromod-server/common/build/libs/ and pre-built binaries are available under release/macromod-server-*.jar.
评论 0
登录后参与评分
还没有评论,来抢沙发吧