一个仅服务端的 Minecraft 1.20.1 / Forge 模组,通过配置文件禁用选定的状态效果、实体生成和伤害类型。所有匹配均基于注册表 ID(modid:key),因此其他模组添加的状态效果、实体、伤害类型和维度也可以进行配置。
全局禁用状态效果 — globallyDisabledEffects
格式:modid:effectid
globallyDisabledEffects = ["minecraft:resistance"]
阻止特定实体获得特定效果 — entityEffectBans
格式:modid:entityid&modid:effectid(实体在前)
entityEffectBans = ["minecraft:iron_golem&minecraft:health_boost"]
含义:铁傀儡无法获得生命提升效果。
全局禁用实体生成 — globallyDisabledSpawns
格式:modid:entityid
globallyDisabledSpawns = ["minecraft:creeper"]
在特定维度禁用实体生成 — dimensionSpawnBans
格式:modid:dimensionid&modid:entityid
dimensionSpawnBans = ["minecraft:the_end&minecraft:enderman"]
含义:末影人不再在末地自然生成。
在特定维度禁用某模组的实体 — modLivingDimensionSpawnBans / modNonLivingDimensionSpawnBans
格式:modid&modid:dimensionid(第一部分为实体注册表命名空间,即模组 ID)
modLivingDimensionSpawnBans = ["minecraft&minecraft:the_end"] # 末地中无原版活体实体
modNonLivingDimensionSpawnBans = ["minecraft&minecraft:the_end"] # 末地中无原版非活体实体(物品/投射物/矿车等)
含义:在特定维度禁用整个模组(按注册表命名空间)的活体或非活体实体。此规则基于 EntityJoinLevelEvent,比上述生成禁令更彻底:
- 涵盖活体和非活体实体,包括掉落的物品、投射物、矿车以及其他从不参与自然生成的实体;
- 不仅防止新生成——当区块加载时,该维度中已存在的实体也会被移除;使用刷怪蛋和
/summon 命令也无效。
警告:像示例中那样禁用某个模组的所有实体很容易导致世界损坏——请谨慎使用。特别注意,玩家也是 LivingEntity:如果 modLivingDimensionSpawnBans 在末地禁用了 minecraft 命名空间,进入末地的玩家会被直接移除。
全局替换伤害类型 — damageReplacements
格式:modid:damagetypeid 或 modid:damagetypeid&modid:newdamagetypeid
- 仅有一个分段时,伤害被替换为
minecraft:mob_attack;
- 有两个分段时,替换为指定的新伤害类型。
damageReplacements = [
"minecraft:on_fire", # 火焰伤害 → mob_attack
"minecraft:player_attack&minecraft:mob_attack",
]
实体伤害规则(免疫/替换) — entityDamageRules
格式:modid:entityid&modid:damagetypeid 或 modid:entityid&modid:damagetypeid&modid:newdamagetypeid
- 有两个分段时,实体对该伤害免疫;
- 有三个分段时,实体受到的伤害被替换为新伤害类型。
entityDamageRules = [
"minecraft:creeper&minecraft:on_fire", # 苦力怕对火焰伤害免疫
"minecraft:creeper&minecraft:on_fire&minecraft:mob_attack", # 苦力怕受到的火焰伤害变为 mob_attack
]
注意事项与限制
- 效果禁用仅防止新的施加;已经生效的效果会自然消失,不会被主动移除。
- 生成禁令涵盖自然生成、刷怪笼和其他
FinalizeSpawn 路径;/summon 命令和已存在于加载区块中的实体不受影响。
- 伤害替换被视为伤害原本就是新类型来处理(护甲减免、无敌检查等均遵循新伤害类型)。
- 配置了但未注册的伤害类型将回退到
minecraft:mob_attack,并在服务器日志中记录一次警告。
A server-side only Minecraft 1.20.1 / Forge mod that disables selected status effects, entity spawns and damage types through a config file. All matching is based on registry IDs (modid:key), so status effects, entities, damage types and dimensions added by other mods can also be configured.
Globally disable status effects — globallyDisabledEffects
Format: modid:effectid
globallyDisabledEffects = ["minecraft:resistance"]
Prevent a specific entity from gaining a specific effect — entityEffectBans
Format: modid:entityid&modid:effectid (entity first)
entityEffectBans = ["minecraft:iron_golem&minecraft:health_boost"]
Meaning: Iron Golems cannot gain Health Boost.
Globally disable entity spawns — globallyDisabledSpawns
Format: modid:entityid
globallyDisabledSpawns = ["minecraft:creeper"]
Disable entity spawns in a specific dimension — dimensionSpawnBans
Format: modid:dimensionid&modid:entityid
dimensionSpawnBans = ["minecraft:the_end&minecraft:enderman"]
Meaning: Endermen no longer naturally spawn in the End.
Disable a mod's entities in a specific dimension — modLivingDimensionSpawnBans / modNonLivingDimensionSpawnBans
Format: modid&modid:dimensionid (the first part is the entity registry namespace, i.e. the mod id)
modLivingDimensionSpawnBans = ["minecraft&minecraft:the_end"] # no vanilla living entities in the End
modNonLivingDimensionSpawnBans = ["minecraft&minecraft:the_end"] # no vanilla non-living entities (items/projectiles/minecarts...)
Meaning: disables a whole mod's (by registry namespace) living or non-living entities in a specific dimension. This rule is based on EntityJoinLevelEvent and is more thorough than the spawn bans above:
- Covers both living and non-living entities, including dropped items, projectiles, minecarts and other entities that never participate in natural spawning;
- Not only prevents new spawns — entities already present in the dimension are removed when their chunks load; spawn eggs and
/summon are also ineffective.
Warning: disabling all of a mod's entities like in the example can easily break the world — use with care. Note in particular that players are also LivingEntity: if modLivingDimensionSpawnBans bans the minecraft namespace in the End, players entering the End will be removed outright.
Globally replace damage types — damageReplacements
Format: modid:damagetypeid or modid:damagetypeid&modid:newdamagetypeid
- With one segment only, the damage is replaced with
minecraft:mob_attack;
- With two segments, it is replaced with the specified new damage type.
damageReplacements = [
"minecraft:on_fire", # fire damage → mob_attack
"minecraft:player_attack&minecraft:mob_attack",
]
Entity damage rules (immunity / replacement) — entityDamageRules
Format: modid:entityid&modid:damagetypeid or modid:entityid&modid:damagetypeid&modid:newdamagetypeid
- With two segments, the entity is immune to that damage;
- With three segments, the damage the entity takes is replaced with the new damage type.
entityDamageRules = [
"minecraft:creeper&minecraft:on_fire", # creepers are immune to fire damage
"minecraft:creeper&minecraft:on_fire&minecraft:mob_attack", # fire damage taken by creepers becomes mob_attack
]
Notes and limitations
- Effect disabling only prevents new applications; effects that are already active expire naturally and are never actively removed.
- Spawn bans cover natural spawning, spawners and other
FinalizeSpawn paths; /summon and entities already present in loaded chunks are unaffected.
- Damage replacement is resolved as if the damage was originally the new type (armor reduction, invulnerability checks, etc. all follow the new damage type).
- Damage types that are configured but not registered fall back to
minecraft:mob_attack, and a warning is logged once in the server log.
评论 0
登录后参与评分
还没有评论,来抢沙发吧