
一款简单的模组,利用 Minecraft 中早已鲜为人知的“幸运”实体属性重新设计了战利品生成机制。该属性此前仅在使用“海之眷顾”附魔进行钓鱼时出现过。拥有幸运值后,在生成战利品时,会根据每个条目的品质值重新计算其在战利品池中的概率。这些重新计算的概率将平均带来更高质量的战利品。
如何游玩
提升幸运值的基本方法是饮用幸运药水,现在它们已经可以制作了。要制作这些药水,你需要用四叶草酿造笨拙药水(awkward potions),而四叶草可以从草丛中获得。和任何可制作的原版药水一样,你可以加入红石来增加持续时间,或者加入荧石来酿造持续较短的幸运药水 II 级。同样地,你也可以制作喷溅型和滞留型药水。随后可使用这些药水辅助你寻找 Gems of Fortune 以及 Fortuned Traveller Perk Smithing Template,将其附在盔甲上可为每件护甲提供 +1 幸运加成。因此,生存模式下可获得的最大幸运值为 6(一套完整盔甲加上幸运药水 II 级)。拥有 6 点幸运值时,你可以从箱子中获取极其丰厚的战利品(可能过于强大,由于尚未充分测试,我无法确定):
当然,获取这些物品相对困难,因为它们相当稀有,仅能在考古遗址、沙漠神殿、水下遗迹和沉船宝箱中以较低几率找到。幸运度也会影响可疑砾石和可疑沙子的掉落物。女巫和远古守卫者有几率给玩家施加“不幸”诅咒,这将扣除幸运点数并导致获得更差的战利品。
兼容性 / 故障排除
本模组应与大多数模组兼容,但它可能会与其他直接修改战利品池(loot pools)和战利品表(loot tables)的模组发生冲突。如果你怀疑存在这种情况,可以先尝试禁用我所做的战利品池逻辑重构。为此,请前往你的配置目录(通常是 /.minecraft/config/),你应该能找到 lucky_charm.txt 文件(如果由于某些原因该文件不存在,请手动创建它)。文件内容应如下所示:
doHyperLoot: true
replaceChestLootTables: true
replaceArchaeologyLootTables: true
exceptions: []
将 doHyperLoot 设置为 false 即可解决问题。不过,这样做会使战利品池默认恢复为原版 Minecraft 的逻辑,其结果与我的算法差异很大,你可能也会更喜欢这种方式。如果这解决了不兼容问题,你还可以尝试通过将对应手段设置为 false 来禁用对原版战利品表的替换。这将基本上禁用所有游戏性更改,因为它将使用不受幸运值影响的默认原版战利品表。exceptions 字段用于指定特定的战利品表以绕过你配置的任何设置。你可以在方括号内列出战利品表的名称,用逗号分隔条目或跨多行排列。要检查战利品表的名称,请前往 /.minecraft/versions/{your_version}/{your_version}.jar,使用 7-Zip 等工具打开该 .jar 文件,然后进入 /data/minecraft/loot_tables/{your_case}/{loot_table_name}.json,文件名即为战利品表的名称。请准确写出 .json 文件的名称。如果上述方法均无效且你仍然遇到问题,可以在 问题追踪器 中报告你的情况。
自定义战利品表
本模组支持通过数据包添加或更改的自定义战利品表。这不仅限于容器战利品表,还包括任何类型的战利品表以及任何模组。为了利用幸运机制,你只需在每个表的每个战利品池条目的定义中添加一个 "quality" 整数字段。示例 (loot_table.json):
{
"pools": [
{
"rolls": {
"min": 2,
"max": 4
},
"entries": [
{
"type": "item",
"name": "minecraft:golden_apple",
"weight": 20,
"quality": 2
},
{
"type": "item",
"name": "minecraft:appleEnchanted",
"weight": 1,
"quality": 4
},
{
"type": "item",
"name": "minecraft:name_tag",
"weight": 30
}
]
}
]
}
如果你未包含此字段,它将默认为 0。
当前状态与未来计划
本模组仍处于早期测试阶段,因此可能包含错误,游戏性也可能不平衡且缺乏新鲜感。部分原因在于游戏性中主观的质量感知和运气成分,这也是我希望制作一个更完善版本的原因:通过友好的用户界面实现游戏内战利品池的动态配置,使其兼容任何模组的战利品表,并采用此算法优化幸运战利品表。如果你阅读了以上内容并期待体验我的模组,欢迎留下反馈,非常感谢 :)。

A simple mod that reworks loot generation in minecraft using the long-forgotten luck entity attribute only previously used in fishing gameplay when using the luck of the sea enchantment. When having luck, new probabilities for each entry in the loot pool are calculated when generating the loot. The probabilities calculated will give on average better quality loot according to each entry's quality value.
How to play
The basic way you can increase your luck is by drinking luck potions, which are now craftable. To craft them you need to brew awkward potions with a four leaf clover, which you can obtain from grass. Like any other craftable vanilla potion, you can either add redstone to increase the duration or glowstone to brew a Luck II potion for less duration. Similarly you can make splash and lingering potions. You may then use these potions to aid in your search for Gems of Fortune and the Fortuned Traveller Perk Smithing Template which when applied to your armor give a +1 luck boost for each armor piece. The maximum survival-obtainable luck value would then be 6 (a full set of armor plus Luck II potions). With Luck 6 you can obtain insane loot from chests (might be overpowered I haven't playtested enough to be sure):
Then of course, obtaining these items is relatively hard as they are quite rare and can only be found in archaeology sites, desert pyramids, underwater ruins, and shipwreck treasure chests with low chances. Luck also affects the loot from suspicious gravel and suspicious sand. Witches and Elder Guardians have a chance to curse the player with unluckiness which would subtract luck points and give worse loot.
Compatibility / Troubleshooting
This mod should be compatible with most mods, however it might conflict with other mods that directly change loot pools and loot tables. If you suspect this is the case you may first want to try deactivating the loot pool logic rework I've done. To do this, go to your config directory (usually /.minecraft/config/) and you should find lucky_charm.txt (if it does not exist for some reason just create it). The file should look like this:
doHyperLoot: true
replaceChestLootTables: true
replaceArchaeologyLootTables: true
exceptions: []
So set doHyperLoot: false and that should do the trick. However this then defaults to the original minecraft logic for loot pools which gives very different results to my algorithm, you may also prefer this. If this does fix the incompatibility you may then also want to try deactivating the replacement of vanilla loot tables by setting the corresponding field to false. This will basically disable all gameplay changes as it will use the default vanilla loot tables which are unaffected by luck. The exceptions field is if you wanted specific loot tables to bypass whatever setting you configured. You would include the name of the loot table in the brackets separating entries by commas or across multiple lines. To check the name of a loot table, go to /.minecraft/versions/{your_version}/{your_version}.jar and open the .jar with 7-zip or alike then go to /data/minecraft/loot_tables/{your_case}/{loot_table_name}.json should tell you the name of the loot table. Write the exact name of the .json file. If none of this works and you still have issues you may report your case in the issue tracker.
Custom Loot Tables
This mod supports custom loot tables added or changed via datapacks. This is not limited to only container loot tables but any kind of loot table and for any mod. To make use of the luck mechanics you just need to define a "quality" integer field for each entry of the loot pool in each table. Example (`loot_table.json'):
{
"pools": [
{
"rolls": {
"min": 2,
"max": 4
},
"entries": [
{
"type": "item",
"name": "minecraft:golden_apple",
"weight": 20,
"quality": 2
},
{
"type": "item",
"name": "minecraft:appleEnchanted",
"weight": 1,
"quality": 4
},
{
"type": "item",
"name": "minecraft:name_tag",
"weight": 30
}
]
}
]
}
If you don't include this field it defaults to a value of 0.
Current state and future plans
This mod is still early beta, so it may contain bugs and the gameplay may be unbalanced and stale. Part of this is due to the subjective perception of quality and luck in gameplay which is why I want to make a better version that enables dynamic configuration of loot pools in game via a friendly UI that would be compatible with any mod's loot tables and would use this algorithm for lucky loot tables. If you read all of this and are looking forward to try my mod feel free to leave feedback and thank you very much :).
评论 0
登录后参与评分
还没有评论,来抢沙发吧