Configurable Difficulty
一个服务端 Minecraft 模组,根据生物群系、维度以及深度调整实体属性。支持 NeoForge 和 Fabric 加载器。
功能
-
三重乘数系统:
- 维度乘数:每个维度的基础难度(下界、末地、模组添加的维度)
- 生物群系乘数:按生物群系缩放难度
- 深度缩放:基于 Y 坐标的渐进式难度(仅限主世界)
- 最终公式:
维度 × 生物群系 × 深度
-
模组生物群系支持:兼容所有生物群系模组
-
模组维度支持:兼容任何维度
-
按实体类型分割属性:
- 玩家:仅获得 Luck(幸运) 属性(更好的战利品质量)
- 生物:获得除 Luck 之外的所有战斗属性(生命值、护甲、伤害等)
-
可配置属性:
- 最大生命值 (Max Health)
- 护甲 (Armor)
- 护甲韧性 (Armor Toughness)
- 攻击伤害 (Attack Damage)
- 攻击速度 (Attack Speed)
- 攻击击退 (Attack Knockback)
- 击退抗性 (Knockback Resistance)
- 幸运 (Luck,仅限玩家)
-
Y 轴坐标深度缩放:
- 仅在主世界生效
- 地下越深 = 难度越高
- 可配置深度阈值和最大深度
- 提供线性缩放模式
配置
配置文件位于 config/configurable-difficulty.json5。
示例配置
{
"enabled": true,
"playerMode": "dynamic",
"mobMode": "spawn_only",
"checkInterval": 20,
// 玩家:始终受影响(仅限幸运属性)
// 生物:哪些实体类型应受影响(除幸运外的所有属性)
"applyToHostileMobs": true,
"applyToPassiveMobs": false,
"applyToNeutralMobs": false,
"debug": {
"enabled": false,
"logBiomeChanges": true,
"logAttributeChanges": true
},
"enabledAttributes": {
// 生物属性:maxHealth, armor, armorToughness, attackDamage, attackSpeed, attackKnockback, knockbackResistance
// 玩家属性:luck(战利品质量)
"maxHealth": true,
"armor": true,
"armorToughness": true,
"attackDamage": true,
"attackSpeed": false,
"attackKnockback": false,
"knockbackResistance": true,
"luck": false
},
"dimensionMultipliers": {
"minecraft:overworld": {
"maxHealth": 1.0,
"armor": 1.0,
"attackDamage": 1.0,
"luck": 1.0
},
"minecraft:the_nether": {
"maxHealth": 1.5,
"armor": 1.3,
"attackDamage": 1.5,
"luck": 1.2
},
"minecraft:the_end": {
"maxHealth": 2.0,
"armor": 1.5,
"attackDamage": 2.0,
"luck": 1.5
}
},
"biomeMultipliers": {
"minecraft:desert": {
"maxHealth": 1.5,
"armor": 0.8,
"attackDamage": 1.3,
"knockbackResistance": 0.1,
"luck": 1.1
},
"minecraft:deep_dark": {
"maxHealth": 2.5,
"armor": 2.0,
"armorToughness": 1.5,
"attackDamage": 2.0,
"knockbackResistance": 0.4,
"luck": 1.5
}
},
"depthScaling": {
"enabled": false,
"yThreshold": 0,
"maxDepth": -64,
"scalingMode": "linear",
"maxMultipliers": {
"maxHealth": 2.0,
"armor": 1.5,
"attackDamage": 1.5,
"luck": 1.3
}
}
}
乘数计算
任何属性的最终乘数计算如下:
最终乘数 = 维度乘数 × 生物群系乘数 × 深度乘数
示例 1:绯红森林中的下界僵尸
- 维度:下界 → 生命值 1.5 倍
- 生物群系:绯红森林 → 生命值 2.0 倍
- 深度:不适用(深度缩放仅在主世界生效)
- 最终结果:1.5 × 2.0 = 生命值 3.0 倍
示例 2:Y=-32 处深暗之穴中的主世界僵尸
- 维度:主世界 → 生命值 1.0 倍
- 生物群系:深暗之穴 → 生命值 2.5 倍
- 深度:Y=-32(距离 -64 的一半)→ 生命值 1.5 倍
- 最终结果:1.0 × 2.5 × 1.5 = 生命值 3.75 倍
示例 3:末地的玩家
- 维度:末地 → 幸运值 1.5 倍
- 生物群系:默认 → 幸运值 1.0 倍
- 深度:不适用
- 最终结果:1.5 × 1.0 = 幸运值 1.5 倍(更好的掉落!)
添加模组生物群系和维度
添加模组生物群系
只需将生物群系 ID 添加到 biomeMultipliers 部分即可:
"biomeMultipliers": {
"biomesoplenty:ominous_woods": {
"maxHealth": 2.0,
"attackDamage": 1.8
},
"terralith:volcanic_peaks": {
"maxHealth": 2.3,
"armor": 1.8,
"attackDamage": 1.9
}
}
添加模组维度
只需将维度 ID 添加到 dimensionMultipliers 部分即可:
"dimensionMultipliers": {
"minecraft:overworld": {
"maxHealth": 1.0,
"attackDamage": 1.0,
"luck": 1.0
},
"twilightforest:twilight_forest": {
"maxHealth": 1.3,
"attackDamage": 1.3,
"luck": 1.1
},
"aether:the_aether": {
"maxHealth": 0.8,
"attackDamage": 0.8,
"luck": 1.2
}
}
注意:未配置的维度会自动回退到主世界设置作为基准。
工作原理
乘数系统
该模组使用三层乘数系统应用属性修改器:
-
维度乘数:整个维度的基础难度
- 应用于该维度中的所有实体
- 较高的值会使整个维度更难
-
生物群系乘数:特定生物群系的难度
- 叠加在维度乘数之上
- 更危险的生物群系具有更高的乘数
-
深度乘数:基于 Y 坐标的渐进式难度
- 仅在主世界生效
- 地下越深的实体面临更高的乘数
- 可配置阈值和最大深度
最终公式:维度 × 生物群系 × 深度
玩家属性分割
玩家获得的属性与生物不同:
-
玩家:仅获得 Luck(幸运) 属性
- 影响从方块、生物和箱子中获得的战利品质量
- 动态模式:随着玩家在生物群系间移动而更新
- 生成时模式:在生成时设定,永不改变
-
生物:获得战斗属性(除幸运值外)
- 最大生命值、护甲、护甲韧性
- 攻击伤害、攻击速度、击退抗性
- 击退抵抗
- 仅生成模式:在生成时设定,永久有效
仅生成模式(生物的默认模式)
当实体生成时:
- 检查生成的维度与生物群系
- 计算组合倍率(维度 × 生物群系)
- 应用属性倍率
- 实体将永久保留这些数值,即使移动到其他区域也不会改变
动态模式(玩家的默认模式)
每经过 checkInterval 刻(默认为 20 刻 = 1 秒):
- 检查实体当前所在的维度与生物群系
- 若与前一次不同,则重新计算倍率
- 移除旧的修饰符并应用新的修饰符
- 最大生命值变化时,保持生命值的百分比不变
深度缩放(仅限主世界)
- 仅在主世界维度生效
- 根据 Y 坐标提供渐进式难度调整
- 可通过
depthScaling 配置部分进行自定义
yThreshold:开始缩放的 Y 层级(高于此值无加成)
maxDepth:达到最大倍率的 Y 层级
scalingMode:目前支持“线性”缩放
maxMultipliers:在 maxDepth 处达到的最大倍率
示例(配置:yThreshold=0, maxDepth=-64):
- Y=0 至 63:1.0x(无深度加成)
- Y=-32:1.5x(接近最大值的一半)
- Y=-64:2.0x(最大深度加成)
Configurable Difficulty
A server-side Minecraft mod that adjusts entity attributes based on their biome, dimension, and depth. Supports both NeoForge and Fabric mod loaders.
Features
-
Triple Multiplier System:
- Dimension Multipliers: Base difficulty per dimension (Nether, End, modded dimensions)
- Biome Multipliers: Difficulty scaling per biome
- Depth Scaling: Progressive difficulty based on Y-coordinate (Overworld only)
- Final Formula:
Dimension × Biome × Depth
-
Modded Biome Support: Works with ALL biome mods
-
Modded Dimension Support: Works with ANY dimension
- Auto-fallback: Unconfigured dimensions use Overworld as baseline
-
Attribute Split by Entity Type:
- Players: Only receive Luck attribute (better loot quality)
- Mobs: Receive all combat attributes (Health, Armor, Damage, etc.) except Luck
-
Configurable Attributes:
- Max Health
- Armor
- Armor Toughness
- Attack Damage
- Attack Speed
- Attack Knockback
- Knockback Resistance
- Luck (players only)
-
Y-Coordinate Depth Scaling:
- Applies only in Overworld
- Deeper underground = harder difficulty
- Configurable depth threshold and max depth
- Linear scaling mode available
Configuration
The config file is located at config/configurable-difficulty.json5.
Example Configuration
{
"enabled": true,
"playerMode": "dynamic",
"mobMode": "spawn_only",
"checkInterval": 20,
// Players: Always affected (luck attribute only)
// Mobs: Which entity types should be affected (all attributes except luck)
"applyToHostileMobs": true,
"applyToPassiveMobs": false,
"applyToNeutralMobs": false,
"debug": {
"enabled": false,
"logBiomeChanges": true,
"logAttributeChanges": true
},
"enabledAttributes": {
// Mob attributes: maxHealth, armor, armorToughness, attackDamage, attackSpeed, attackKnockback, knockbackResistance
// Player attribute: luck (loot quality)
"maxHealth": true,
"armor": true,
"armorToughness": true,
"attackDamage": true,
"attackSpeed": false,
"attackKnockback": false,
"knockbackResistance": true,
"luck": false
},
"dimensionMultipliers": {
"minecraft:overworld": {
"maxHealth": 1.0,
"armor": 1.0,
"attackDamage": 1.0,
"luck": 1.0
},
"minecraft:the_nether": {
"maxHealth": 1.5,
"armor": 1.3,
"attackDamage": 1.5,
"luck": 1.2
},
"minecraft:the_end": {
"maxHealth": 2.0,
"armor": 1.5,
"attackDamage": 2.0,
"luck": 1.5
}
},
"biomeMultipliers": {
"minecraft:desert": {
"maxHealth": 1.5,
"armor": 0.8,
"attackDamage": 1.3,
"knockbackResistance": 0.1,
"luck": 1.1
},
"minecraft:deep_dark": {
"maxHealth": 2.5,
"armor": 2.0,
"armorToughness": 1.5,
"attackDamage": 2.0,
"knockbackResistance": 0.4,
"luck": 1.5
}
},
"depthScaling": {
"enabled": false,
"yThreshold": 0,
"maxDepth": -64,
"scalingMode": "linear",
"maxMultipliers": {
"maxHealth": 2.0,
"armor": 1.5,
"attackDamage": 1.5,
"luck": 1.3
}
}
}
Multiplier Calculation
The final multiplier for any attribute is calculated as:
Final Multiplier = Dimension Multiplier × Biome Multiplier × Depth Multiplier
Example 1: Nether Zombie in Crimson Forest
- Dimension: Nether → 1.5x health
- Biome: Crimson Forest → 2.0x health
- Depth: N/A (depth scaling only in Overworld)
- Final: 1.5 × 2.0 = 3.0x health
Example 2: Overworld Zombie in Deep Dark at Y=-32
- Dimension: Overworld → 1.0x health
- Biome: Deep Dark → 2.5x health
- Depth: Y=-32 (halfway to -64) → 1.5x health
- Final: 1.0 × 2.5 × 1.5 = 3.75x health
Example 3: Player in The End
- Dimension: The End → 1.5x luck
- Biome: Default → 1.0x luck
- Depth: N/A
- Final: 1.5 × 1.0 = 1.5x luck (better loot drops!)
Adding Modded Biomes and Dimensions
Adding Modded Biomes
Simply add the biome ID to the biomeMultipliers section:
"biomeMultipliers": {
"biomesoplenty:ominous_woods": {
"maxHealth": 2.0,
"attackDamage": 1.8
},
"terralith:volcanic_peaks": {
"maxHealth": 2.3,
"armor": 1.8,
"attackDamage": 1.9
}
}
Adding Modded Dimensions
Simply add the dimension ID to the dimensionMultipliers section:
"dimensionMultipliers": {
"minecraft:overworld": {
"maxHealth": 1.0,
"attackDamage": 1.0,
"luck": 1.0
},
"twilightforest:twilight_forest": {
"maxHealth": 1.3,
"attackDamage": 1.3,
"luck": 1.1
},
"aether:the_aether": {
"maxHealth": 0.8,
"attackDamage": 0.8,
"luck": 1.2
}
}
Note: Unconfigured dimensions automatically fall back to the Overworld settings as a baseline.
How It Works
Multiplier System
The mod applies attribute modifiers using a three-tier multiplier system:
-
Dimension Multiplier: Base difficulty for the entire dimension
- Applied to all entities in that dimension
- Higher values make the whole dimension harder
-
Biome Multiplier: Specific difficulty per biome
- Applied on top of the dimension multiplier
- More dangerous biomes have higher multipliers
-
Depth Multiplier: Progressive difficulty based on Y-coordinate
- Only applies in the Overworld
- Entities deeper underground face higher multipliers
- Configurable threshold and max depth
Final Formula: Dimension × Biome × Depth
Player Attribute Split
Players receive different attributes than mobs:
Spawn-Only Mode (Default for Mobs)
When an entity spawns:
- Checks the spawn dimension and biome
- Calculates combined multiplier (dimension × biome)
- Applies attribute multipliers
- Entity keeps those stats forever, even if it moves
Dynamic Mode (Default for Players)
Every checkInterval ticks (default 20 = 1 second):
- Checks entity's current dimension and biome
- If changed from previous, recalculates multiplier
- Removes old modifiers and applies new ones
- Health percentage is preserved when max health changes
Depth Scaling (Overworld Only)
- Applies only in the Overworld dimension
- Progressive difficulty based on Y-coordinate
- Configurable via
depthScaling config section
yThreshold: Y-level where scaling starts (above = no bonus)
maxDepth: Y-level where max multiplier is reached
scalingMode: Currently supports "linear" scaling
maxMultipliers: Maximum multipliers at maxDepth
Example (config: yThreshold=0, maxDepth=-64):
- Y=0 to 63: 1.0x (no depth bonus)
- Y=-32: 1.5x (halfway to max)
- Y=-64: 2.0x (maximum depth bonus)
评论 0
登录后参与评分
还没有评论,来抢沙发吧