概览
InControlMob 是一款适用于 Minecraft 1.21 的 Spigot/Paper 插件,为服务器管理员提供了一套强大的、基于规则的系统,用于控制生物生成、刷怪笼行为、召唤实体、战利品和经验值。规则以纯 JSON 文件形式存储在 config/incontrolmob/ 目录中,支持热重载,并在加载时进行验证,使您无需更改代码即可安全地自定义服务器行为。
主要功能
- 基于规则的生成、刷怪笼、召唤、战利品和经验值事件控制
- 带有模式验证和清晰错误报告的 JSON 规则
- 支持
/incontrolmob reload 热重载——无需重启服务器
- 丰富的条件判断:实体类型、世界、生物群系、光照等级、生成原因、一天中的时间、难度、附近玩家、NBT 匹配、WorldGuard 区域检查等
- 强大的动作执行:允许/禁止生成、修改生命值、设置装备、添加药水效果、替换实体类型、修改掉落物和经验值、设置实体标志(无重力、无敌、发光、持久化)、改变速度/乘客
- 优先级与控制:规则
priority、enabled 标志、continueOnMatch 选项以及文件顺序语义
- 安全且高效:异步规则加载、规则集原子交换、按 entityType/spawnReason 缓存与索引、通过配置控制的调试日志
- 可选的 WorldGuard 集成:当存在 WorldGuard 时进行区域检查;缺失时优雅降级
- 管理工具:列出规则、测试规则、导出规则以便分享
安装方法
- 将编译好的
InControlMob.jar 放入 Paper 1.21 服务器的 plugins/ 文件夹中
- 启动服务器一次以生成
config/incontrolmob/ 文件夹及示例 JSON 文件
- 编辑 JSON 文件以定义您的规则
- 使用
/incontrolmob reload 即时应用更改
默认 config.yml
enabled: true
debug: false
default-action: allow
max-rule-load-time-ms: 5000
rule-cache-size: 1024
命令
/incontrolmob reload —— 重新加载所有 JSON 规则并报告错误
/incontrolmob rules list —— 列出已加载的规则,包括 ID、优先级和启用状态
/incontrolmob rule test <ruleId> <entityType> —— 在您所在位置模拟规则评估
/incontrolmob export —— 将当前加载的所有规则导出为单个归档文件
权限节点
incontrolmob.reload —— 允许重载
incontrolmob.manage —— 管理规则和导出
incontrolmob.test —— 运行规则测试
示例
- 阻止猪生成:在
spawn.json 中添加 deny_pigs_global,然后重载,猪将不再自然生成
- 强化僵尸:添加
strong_zombies_plains_night,重载后,在平原夜间生成的僵尸将拥有 40 点生命值、铁剑和速度药水效果
- 刷怪笼替换:在
spawner.json 中添加一条规则,将僵尸替换为骷髅
故障排除
- 在
config.yml 中启用 debug: true 以获取详细日志
- 重载时请检查控制台是否有模式验证错误;无效规则将被跳过并报告
- 如果 WorldGuard 检查失败,请确认已安装并兼容 WorldGuard
- 为保证性能,请确保
rule-cache-size 设置合理,并避免过于宽泛的规则
致谢
本插件灵感来源于 In Control! Mod。
InControlMob 是一款独立的服务端插件,专为 Paper/Spigot 构建,将类似的基于规则的生物控制功能带入多人服务器。
许可证
根据 Creative Study Lab License 发布。(类 MIT 宽松许可)。详细信息请参阅 License 文件。
Overview
InControlMob is a Spigot/Paper plugin for Minecraft 1.21 that gives server admins a powerful, rule‑driven system to control mob spawning, spawner behavior, summoned entities, loot, and experience. Rules are plain JSON files stored in config/incontrolmob/, hot‑reloadable, and validated on load so you can safely customize server behavior without code changes.
Key Features
- Rule‑driven control for spawn, spawner, summon, loot, and experience events
- JSON rules with schema validation and clear error reporting
- Hot reload with
/incontrolmob reload — no server restart required
- Rich conditions: entity type, world, biome, light level, spawn reason, time of day, difficulty, nearby players, NBT match, WorldGuard region checks, and more
- Powerful actions: allow/deny spawn, change health, set equipment, add potion effects, replace entity type, modify drops and XP, set entity flags (noGravity, invulnerable, glowing, persistent), velocity/passenger changes
- Priority and control: rule
priority, enabled flag, continueOnMatch option, and file order semantics
- Safe and performant: asynchronous rule loading, atomic swap of rule sets, caching and indexing by entityType/spawnReason, debug logging controlled by config
- Optional WorldGuard integration: region checks when WorldGuard is present; graceful degradation when absent
- Admin tools: list rules, test rules, and export rules for sharing
Installation
- Place the compiled
InControlMob.jar into your server plugins/ folder for Paper 1.21
- Start the server once to generate the
config/incontrolmob/ folder and sample JSON files
- Edit the JSON files to define your rules
- Use
/incontrolmob reload to apply changes instantly
Default config.yml
enabled: true
debug: false
default-action: allow
max-rule-load-time-ms: 5000
rule-cache-size: 1024
Commands
/incontrolmob reload — reload all JSON rules and report errors
/incontrolmob rules list — list loaded rules with id, priority, and enabled state
/incontrolmob rule test <ruleId> <entityType> — simulate rule evaluation at your location
/incontrolmob export — export current loaded rules to a single archive
Permissions
incontrolmob.reload — allow reload
incontrolmob.manage — manage rules and export
incontrolmob.test — run rule tests
Examples
- Block pigs: add
deny_pigs_global to spawn.json, reload, pigs will no longer spawn
- Strong zombies: add
strong_zombies_plains_night, reload, zombies in Plains at night spawn with 40 HP, iron sword, and speed effect
- Spawner replacement: add a
spawner.json rule to replace zombies with skeletons
Troubleshooting
- Enable
debug: true in config.yml for detailed logs
- On reload, check console for schema validation errors; invalid rules are skipped and reported
- If WorldGuard checks fail, confirm WorldGuard is installed and compatible
- For performance, ensure
rule-cache-size is reasonable and avoid overly broad rules
Credits
This plugin was inspired by the In Control! Mod.
InControlMob is an independent server‑side plugin built for Paper/Spigot, bringing similar rule‑based mob control features to multiplayer servers.
License
Released under the Creative Study Lab License. (MIT‑style permissive). See the License file for details.
评论 0
登录后参与评分
还没有评论,来抢沙发吧