NoMaxEnchant
移除铁砧的附魔等级上限,使得合并超出原版上限(例如锋利 VI、保护 V)的附魔书时,附魔会按其实际等级生效,而不是静默回退到原版最大值。
解决的问题
原版铁砧始终会将附魔结果限制在其自身的 getLevel() 范围内,无论数据包、战利品表或其他模组向用户试图应用的附魔书中放入了什么。两本锋利 V 的书合并后仍然是锋利 V,即使该附魔本身能够达到更高等级;铁砧会丢弃多余的等级。
NoMaxEnchant 移除了这一限制。铁砧计算自然产生的任何等级都会应用,最高不超过硬性上限 255。
环境要求
仅服务端。 该模组只需在服务端运行;它所修补的铁砧计算由服务端权威控制。
已知局限性
仅限铁砧。 任何其他设置附魔等级的方式(命令、其他模组的自定义附魔机制)均不受影响。
机制
- 目标:仅针对铁砧的附魔等级计算(
updateResult)。铁砧行为的其他方面(修复成本、物品名称、经验值成本、槽位)均不触碰。
- 默认行为:在没有配置(
"globalCap": -1,空的 perEnchantment)的情况下,模组不会产生任何可见效果。它会原样返回 vanillaMax,这与 getLevel() 原本会返回的内容完全一致。只有当设置了 globalCap 或 perEnchantment 条目时,限制才会开始生效。
- 全局上限:可选的全局等级天花板,同时应用于所有附魔。
- 按附魔设定的上限:可选的单个附魔覆盖,通过其 ID(例如
minecraft:sharpness)指定,优先级高于全局上限。
- 硬性上限:无论配置如何,没有任何附魔能超过 255 级。这不是设计选择,而是 Minecraft 引擎的限制(MC-231508)。
- 一级附魔:最大等级已为 1 的附魔保持不变(无需解除上限)。
原版有效最大等级
Minecraft 对大多数附魔的有效最高等级有严格的内部限制。将等级提升至这些点以上在游戏中不会产生额外效果(甚至可能破坏机制,如钓鱼竿的 Luck 或迅捷充能的 Quick Charge)。
完整的参考信息可在 GitHub 上查看;其中包含每个超出正常最大值的原版附魔的完整表格及说明。
配置
首次运行时,NoMaxEnchant 会写入 config/nomaxenchant.json:
{
"globalCap": -1,
"perEnchantment": {
"dummy:dummy": 42
}
}
globalCap:任何 > 0 的值将成为没有特定覆盖项的所有附魔的等级上限。-1(默认值)表示“无全局上限,回退至原版最大值”。
perEnchantment:将附魔 ID 映射到其各自的等级上限。优先级高于 globalCap。dummy:dummy 条目是一个占位符,显示预期格式;它不匹配任何真实附魔,可以删除。
如果配置文件缺失、为空或解析失败,NoMaxEnchant 将回退到原版行为(无上限更改)并记录警告;它绝不会因配置文件错误而导致服务器崩溃。
示例配置
GitHub 上有一个现成的配置文件,它将每个原版附魔设置为真正的有效最大等级。
你可以:
- 直接将其复制为
./config/nomaxenchant.json
- 以此为基础进行修改
- 添加模组附魔的条目
NoMaxEnchant
Removes the anvil's enchantment level clamp, so combining books above the vanilla cap (e.g. Sharpness VI, Protection V) applies the enchantment at its real level instead of silently dropping back to vanilla max.
The problem this solves
Vanilla always clamps an enchantment's result on an anvil to its own getMaxLevel(), no matter what datapacks, loot table or other mods put into the book the user tries to apply. Two Sharpness V books combine into Sharpness V, even if the enchantment itself is able to go higher; the anvil throws the extra level away.
NoMaxEnchant removes that clamp. Whatever level the anvil calculation would naturally produce is what applies, up to a hard ceiling of 255.
Environment
Server-side only. The mod only needs to run on the server; the anvil calculation it patches is server-authoritative.
Known limitations
Anvil only. Any other way an enchantment's level could be set (commands, other mods' custom enchanting mechanics) isn't affected.
Mechanics
- Target: only the anvil's enchantment level calculation (
updateResult). Nothing else about anvil behavior (repair cost, item name, XP cost, slots) is touched.
- Default behavior: with no configuration (
"globalCap": -1, empty perEnchantment), the mod does nothing observable. It returns vanillaMax unchanged, exactly what getMaxLevel() would have returned anyway. The clamp only starts doing something once globalCap or a perEnchantment entry is set.
- Global cap: an optional single level ceiling applied to every enchantment at once.
- Per-enchantment cap: an optional override for individual enchantments, by their id (e.g.
minecraft:sharpness), taking priority over the global cap.
- Hard ceiling: no enchantment can ever exceed level 255, regardless of configuration. This isn't a design choice, it's a Minecraft engine limit (MC-231508).
- Level 1 enchantments: enchantments whose max is already 1 are left untouched (nothing to uncap).
Vanilla effective max levels
Minecraft has hard internal limits on how high most enchantments can usefully go. Raising a level past these points produces no additional effect in-game (or can even break the mechanic, as with Lure or Quick Charge).
The full reference is available on GitHub; complete table of every vanilla enchantment that scales past its normal maximum, with explanations.
Configuration
On first run, NoMaxEnchant writes config/nomaxenchant.json:
{
"globalCap": -1,
"perEnchantment": {
"dummy:dummy": 42
}
}
globalCap: any value > 0 becomes the level ceiling for every enchantment that has no specific override. -1 (default) means "no global cap, fall back to vanilla max".
perEnchantment: maps an enchantment's id to its own cap. Takes priority over globalCap. The dummy:dummy entry is a placeholder showing the expected format; it doesn't match any real enchantment and can be removed.
If the config file is missing, empty or fails to parse, NoMaxEnchant falls back to vanilla behavior (no cap changes) and logs a warning; it never crashes the server over a bad config file.
Example configuration
There's a ready-to-use config on GitHub that sets every vanilla enchantment to its true effective maximum.
You can:
- Copy it directly as
./config/nomaxenchant.json
- Use it as a base
- Add entries for modded enchantments
评论 0
登录后参与评分
还没有评论,来抢沙发吧