怪物热爱黑暗
一款适用于 Minecraft 1.20.1、1.21.1 和 1.21.11 的 Fabric 模组,使特定怪物有机会锁定并摧毁附近的照明源,从而制造危险的黑暗区域,并奖励那些保持警惕的玩家。
功能说明
某些怪物会偶尔锁定附近的火把、灯笼和营火,并试图将它们摧毁。被锁定的怪物会发光并发出灵魂火焰粒子,让观察敏锐的玩家在照明消失前有机会做出反应。一旦怪物到达照明源,它会将其破坏,播放独特的声音,并在新形成的黑暗中恢复正常行为。
幻翼可能会在其俯冲攻击期间偶尔摧毁暴露的火把,这使得夜间的露天照明变得有些脆弱——但它们 erratic(不可预测)的飞行意味着遮蔽的照明相对安全。
所有内容均可高度自定义配置。
特性
- 可配置的合格怪物类型列表 — 可通过配置文件添加任何怪物
- 可配置的目标方块列表 — 支持任何方块 ID,包括模组添加的方块
- 按怪物类型分配目标概率 — 可以单独调整幻翼与高刷新率怪物(如僵尸)的概率
- 可选的被锁定怪物的发光效果,以便玩家识别
- 锁定过程中可选的灵魂火焰粒子轨迹
- 锁定开始和照明源破坏时可选的独特音效
- 不可达目标按怪物类型列入黑名单,以防止卡住行为
- 兼容方块保护模组 — 受保护的方块会被检测并优雅地列入黑名单
- 所有行为仅发生在服务器端,多人游戏中无需安装客户端组件
默认行为
默认情况下,以下怪物有资格接受“锁定照明”目标:
| 怪物 |
默认资格概率 |
| Zombie |
5% |
| Husk |
5% |
| Zombie Villager |
5% |
| Zombified Piglin |
5% |
| Phantom |
75% |
以下方块默认成为目标:
- Torch / Wall Torch
- Lantern
- Soul Torch / Soul Lantern
- Campfire / Soul Campfire
配置
配置文件在首次启动时生成于 config/mobs-love-darkness.json5。文件中所有字段均包含描述和有效范围。
| 配置项 |
默认值 |
描述 |
LightSourceSearchRadius |
16 |
搜索照明源的方块半径。范围:1–128 |
LightSourceSearchRadiusVertical |
4 |
垂直方向上搜索照明源的方块半径。范围:1–128 |
LightSourceBreakTimeTicks |
20 |
摧毁一个照明源所需的刻数(20 刻 = 1 秒)。范围:1–1200 |
LightFixationChance |
0.05 |
合格的怪物每秒锁定附近照明源的概率。范围:0.0–1.0 |
LightFixationSpeedMultiplier |
0.85 |
锁定时的移动速度倍数(1.0 = 正常速度)。范围:0.1–10.0 |
LightFixationCooldownTicks |
200 |
怪物摧毁照明源后再次锁定前的冷却刻数。范围:0–72000 |
LightFixationMaxGoalTicks |
600 |
放弃单次锁定尝试前所花费的最大刻数。范围:100–72000 |
LightFixationGoalPriority |
3 |
目标优先级(数值越低优先级越高,原版僵尸攻击 = 2)。范围:1–10 |
EnableParticles |
true |
锁定怪物身上的灵魂火焰粒子轨迹 |
EnableSounds |
true |
锁定开始和照明源破坏时的音效 |
EnableLightFixationGlowEffect |
true |
锁定怪物身上的发光轮廓效果 |
TargetableLightSources |
见上文 |
要目标的方块 ID 列表,包括模组添加的方块 |
LightFixationEligibilityChancePerMobType |
见上文 |
怪物出生时获得该目标的概率(按怪物类型) |
性能指南
搜索成本随半径呈立方级增长 — 半径为 128 时的检查方块数量约为半径为 16 时的 ~500 倍。请在搜索半径和怪物资格之间取得平衡:
| 搜索半径 |
推荐的最大合格怪物数量 |
| 16 (默认) |
~50 |
| 32 |
~20 |
| 64 |
~5 |
| 128 |
~1-2 |
LightSourceSearchRadiusVertical(默认值:4)也会影响搜索成本。显著增加该值会降低性能 — 除非你的使用场景特别需要搜索地下区域,否则请将其保持在较低水平。
这些仅是粗略指南。实际影响取决于硬件和其他模组。
添加模组怪物和方块
配置文件列表中可以使用任何有效的方块或实体注册表 ID:
"LightFixationEligibilityChancePerMobType": {
"minecraft:zombie": 0.05,
"minecraft:phantom": 0.75,
"alexsmobs:warped_mosco": 0.10
},
"TargetableLightSources": [
"minecraft:torch",
"minecraft:wall_torch",
"supplementaries:oil_lamp"
]
兼容性
游戏规则
- 本模组遵循
mobGriefing 游戏规则。如果怪物出生时 mobGriefing 已禁用,它将不会获得锁定照明目标。当 mobGriefing 被禁用时,已经拥有该目标的怪物会优雅地停止行动,而不会破坏方块。
兼容:
- Sodium、Iris、Lithium 及其他性能优化模组
- 添加新怪物类型的模组 — 通过配置添加它们
- 添加新照明源方块的模组 — 通过配置添加它们
不影响:
- 光影模组提供的客户端动态光照 — 仅针对实际的-world 方块
- Bedrock Edition — 仅限 Java 版
潜在冲突:
- 完全替换怪物 AI 目标选择器的模组可能会阻止目标注入
- 如果目标优先级与其他模组冲突,请在配置中调整
LightFixationGoalPriority(原版僵尸攻击目标的优先级为 2)
方块保护模组(GriefPrevention、FTB Chunks 等)
— 受保护的方块会在破坏尝试后被检测并列入黑名单,从而防止重复尝试。注意:Fabric 上的 FTB Chunks 怪物破坏保护默认仅涵盖末影人,并且不会阻止本模组的方块破坏 — 请改用 mobGriefing 游戏规则进行全局保护。
已知限制
- 玩家放置的方块与世界自然生成的方块之间没有区别——自然生成的方块同样可以被目标锁定
- 幻翼由于飞行导航的原因,对火把的目标锁定不够精确——这在一定程度上是有意为之,因为准确锁定幻翼会难以应对
- 禁用
mobGriefing 游戏规则可防止新刷出的生物获得该目标,并阻止已拥有该目标的生物破坏方块
GitHub
许可证
MIT —— 欢迎将此模组包含在整合包中。
Mobs Love Darkness
A Fabric mod for Minecraft 1.20.1, 1.21.1 and 1.21.11 that gives certain mobs a chance to fixate on and destroy nearby light sources, creating dangerous dark zones and rewarding players who pay attention.
What it does
Some mobs will occasionally lock onto nearby torches, lanterns, and campfires and attempt to destroy them. A fixated mob glows and emits soul fire particles, giving an observant player a chance to react before their lighting is gone. Once the mob reaches the light source it breaks it, playing a distinctive sound and returning to normal behavior in the newly created darkness.
Phantoms may occasionally destroy exposed torches during their swooping attacks, making open-air lighting somewhat vulnerable at night — but their erratic flight means covered lighting remains relatively safe.
Everything is highly configurable.
Features
- Configurable list of eligible mob types — any mob can be added via config
- Configurable list of targetable blocks — works with any block ID including modded blocks
- Per-mob-type goal assignment chance — phantoms can be tuned separately from high-spawn mobs like zombies
- Optional glowing effect on fixated mobs for player readability
- Optional soul fire particle trail while fixating
- Optional distinctive sounds on fixation start and light source destruction
- Unreachable targets are blacklisted per-mob to prevent stuck behavior
- Block protection mod compatible — protected blocks are detected and blacklisted gracefully
- All behavior is server-side only, no client installation required for multiplayer
Default behavior
By default, the following mobs are eligible for the light fixation goal:
| Mob |
Default eligibility chance |
| Zombie |
5% |
| Husk |
5% |
| Zombie Villager |
5% |
| Zombified Piglin |
5% |
| Phantom |
75% |
The following blocks are targeted by default:
- Torch / Wall Torch
- Lantern
- Soul Torch / Soul Lantern
- Campfire / Soul Campfire
Configuration
The config file is generated at config/mobs-love-darkness.json5 on first launch. All fields include descriptions and valid ranges directly in the file.
| Config |
Default |
Description |
LightSourceSearchRadius |
16 |
Block radius to search for light sources. Range: 1–128 |
LightSourceSearchRadiusVertical |
4 |
Vertical block radius to search for light sources. Range: 1–128 |
LightSourceBreakTimeTicks |
20 |
Ticks to break a light source (20 ticks = 1 second). Range: 1–1200 |
LightFixationChance |
0.05 |
Chance per second that an eligible mob fixates on a nearby light source. Range: 0.0–1.0 |
LightFixationSpeedMultiplier |
0.85 |
Movement speed multiplier while fixating (1.0 = normal speed). Range: 0.1–10.0 |
LightFixationCooldownTicks |
200 |
Ticks before a mob can fixate again after destroying a light source. Range: 0–72000 |
LightFixationMaxGoalTicks |
600 |
Maximum ticks spent on a single fixation attempt before giving up. Range: 100–72000 |
LightFixationGoalPriority |
3 |
Goal priority (lower = higher priority, vanilla zombie attack = 2). Range: 1–10 |
EnableParticles |
true |
Soul fire particle trail on fixated mobs |
EnableSounds |
true |
Sounds on fixation start and light source destruction |
EnableLightFixationGlowEffect |
true |
Glowing outline on fixated mobs |
TargetableLightSources |
see above |
List of block IDs to target, including modded blocks |
LightFixationEligibilityChancePerMobType |
see above |
Per-mob-type chance to receive the goal on spawn |
Performance guidance
Search cost scales cubically with radius — a radius of 128 checks ~500x more
blocks than a radius of 16. Balance search radius against mob eligibility:
| Search radius |
Recommended max eligible mobs |
| 16 (default) |
~50 |
| 32 |
~20 |
| 64 |
~5 |
| 128 |
~1-2 |
LightSourceSearchRadiusVertical (default: 4) also contributes to search cost.
Increasing it significantly will reduce performance — keep it low unless your
use case specifically requires searching underground.
These are rough guidelines. Actual impact depends on hardware and other mods.
Adding modded mobs and blocks
Any valid block or entity registry ID works in the config lists:
"LightFixationEligibilityChancePerMobType": {
"minecraft:zombie": 0.05,
"minecraft:phantom": 0.75,
"alexsmobs:warped_mosco": 0.10
},
"TargetableLightSources": [
"minecraft:torch",
"minecraft:wall_torch",
"supplementaries:oil_lamp"
]
Compatibility
Game rules
- This mod respects the mobGriefing game rule. If mobGriefing is disabled when a mob spawns, it will not receive the light fixation goal. Mobs that already have the goal when mobGriefing is disabled will stand down gracefully without breaking blocks.
Works with:
- Sodium, Iris, Lithium, and other performance mods
- Mods that add new mob types — add them via config
- Mods that add new light source blocks — add them via config
Does not affect:
- Client-side dynamic lights from shader mods — only actual world blocks are targeted
- Bedrock Edition — Java only
Potential conflicts:
- Mods that completely replace mob AI goal selectors may prevent the goal from being injected
- If goal priority conflicts with another mod, adjust
LightFixationGoalPriority in config (vanilla zombie attack goal is priority 2)
Block protection mods (GriefPrevention, FTB Chunks, etc.)
— protected blocks are detected after a break attempt and blacklisted, preventing repeated attempts. Note: FTB Chunks mob griefing protection on Fabric only covers Endermen by default and will not prevent this mod's block breaking — use the mobGriefing game rule for global protection instead.
Known limitations
- There is no distinction between player-placed and world-generated blocks — blocks that are naturally generated can also be targeted
- Phantoms have imprecise torch-targeting due to their flight navigation — this is somewhat by design, as accurate phantom targeting would be difficult to counter
- Disabling the mobGriefing game rule prevents new mobs from receiving the goal and prevents blocks from being broken by mobs that already have it
GitHub
License
MIT — feel free to include this mod in modpacks.
评论 0
登录后参与评分
还没有评论,来抢沙发吧