Locks Reforged
由 Melonslise 制作的 Locks 模组移植到 Minecraft Forge 1.20.1 的非官方版本。
Locks 是一款小巧但独特的模组,允许你将灵活且通用的锁安装到游戏中的任何方块上——包括来自其他模组的方块。通过动态锁定系统和交互式开锁小游戏来保护你的门、箱子、熔炉等物品。
特性
锁定任意方块
将锁安装在任意方块上——不仅仅是箱子。门、活板门、熔炉、发射器、漏斗以及模组方块均可使用。锁是空间性的,因此一把锁可以同时覆盖多个方块。
七种等级的锁(+自定义!)
| 等级 |
插销数 |
附魔能力 |
抗性 |
开锁强度 |
| Wood |
5 |
15 |
4 |
0.20 |
| Copper |
6 |
16 |
8 |
0.28 |
| Iron |
7 |
14 |
12 |
0.35 |
| Gold |
6 |
22 |
6 |
0.25 |
| Steel |
9 |
12 |
20 |
0.70 |
| Diamond |
11 |
10 |
100 |
0.85 |
| Netherite |
14 |
8 |
200 |
0.95 |
- 插销数 (Pins) —— 开锁小游戏中的插销数量。插销越多,越难打开。
- 附魔能力 (Enchantability) —— 锁获得强力附魔的概率。
- 抗性 (Resistance) —— 抗爆炸能力。钻石和下界合金锁几乎不可摧毁。
- 开锁强度 (Pick Strength) —— 对应开锁器的有效性。数值越高,效果越好。
下界合金物品防火并能在岩浆中生存,就像原版下界合金装备一样。它们是在锻造台上使用下界合金升级模板制作的。
所有锁和开锁器都是完全数据驱动的——你可以通过简单的 JSON 文件添加自己的自定义等级,或者通过配置文件、TOML 覆盖或数据包调整现有属性。无需更改代码!
开锁小游戏
通过交互式插销匹配小游戏来开锁。匹配每个插销以破解组合。高等级的开锁器对更难打开的锁更有效。
开锁器: Wood, Bobby Pin (copper), Iron, Steel, Gold, Diamond, Netherite (+ 自定义)
钥匙与钥匙环
制作与你的锁匹配的钥匙,或使用钥匙环携带多把钥匙。万能钥匙可以打开任何锁。
七种附魔
- Shocking —— 电击失败尝试开锁的玩家(无视护甲)
- Sturdy —— 降低开锁器的有效性
- Complexity —— 完全阻止低等级开锁器
- Silent —— 禁止在访问被拒绝时发出咔哒声
- Auto-Pick —— 有机会瞬间打开锁,绕过小游戏
- Reinforced —— 每级增加抗爆炸能力
- Awareness —— 记住放置锁的人;该玩家无需钥匙即可打开它
每种附魔都可以在服务器配置中单独启用或禁用。
全面防护
锁定的方块受到以下保护:
- 红石激活
- 漏斗抽取
- 活塞移动
- 爆炸
- 破坏(可配置)
基于战利品缩放的锁生成
锁的等级由箱子战利品表内容的价值决定。村庄箱子上装有木或铜锁,而末地城箱子上装有金或钻石锁。低价值战利品的箱子根本不会上锁。
- 多重采样平均 —— 每个战利品表采样 32 次并取平均值,以确保服务器重启后等级分配的一致性。
- 亚线性堆叠计数 —— 物品价值随堆叠大小的平方根缩放,因此 64 个圆石的价值不会超过一把钻石剑。
- 物品价值覆盖 —— 可配置诸如钻石、绿宝石和下界合金等稀有但常见物品的单项基础价值。15 种原版物品拥有合理的默认值。
- 完全可配置,包括每级价值阈值、稀有度乘数和附魔加成。如果需要,也可以切换为随机加权选择。
世界集成
- 锁定的箱子自然生成于具有基于战利品价值缩放等级的结构中
- 迷宫和神殿的战利品中包含开锁器和机制组件
- 工具匠村民出售开锁器和机制组件
- 流浪商人提供稀有的开锁器和附魔锁
添加自定义物品
Locks Reforged 拥有完全数据驱动的物品系统。你可以根据需要,使用三种不同的方法来添加全新的锁和开锁器等级——或调整现有等级。
机制组件
锁机制组件(Wood, Copper, Iron, Steel)是基础的合成材料——它们不是数据驱动的,无法通过配置或数据包添加。每种锁的合成都需要其对应的机制组件作为中心原料。
配置
所有设置都可通过配置文件进行自定义。请注意 locks-server.toml 是按世界设置的,并且位于与其他两个文件不同的位置:
config/locks-common.toml —— 世界生成和物品属性
- Generation Chance —— 锁出现在生成的箱子上的频率(默认:85%,仅在禁用基于战利品缩放的锁时使用)
- Enchant Chance —— 生成的锁带有附魔的频率(默认:40%)
- Generated Locks / Weights —— 世界中出现的锁等级及其相对稀有度
- Loot-Scaled Locks —— 基于箱子战利品价值的锁等级(默认启用)。可配置物品价值、稀有度乘数、附魔加成、每级价值阈值、采样次数和单项价值覆盖
- Lock Stats / Lockpick Stats —— 每级属性覆盖(见上文)
saves/<world>/serverconfig/locks-server.toml —— 服务器端游戏规则(首次加载时按世界生成)
- Lockable Blocks — 可锁定方块的正则表达式(默认:箱子、门、漏斗等)
- Lockable Tags — 成员可被锁定的方块标签
- Max Lockable Volume — 单个锁可覆盖的最大方块数量(默认:6)
- Allow Removing Locks — 是否可以通过潜行移除已解锁的锁(默认:true)
- Protect Lockables — 在生存模式中,已锁定的方块是否不可破坏(默认:true)
- Easy Lock — 一键放置锁(默认:true)
- Hide Lock ID / Hide HUD Enchantments — 工具提示显示选项
- Enchantment Toggles — 单独启用或禁用7种附魔中的每一种
- Netherite Lockpick Unbreakable — 启用后,下界合金开锁器永远不会损坏(默认:false)
config/locks-client.toml — 客户端设置
- Deaf Mode — 用于开锁无障碍性的视觉反馈(默认:true)
过期的配置文件: 当模组更新并新增等级时(例如铜制锁是在初始版本发布后添加的),现有的 TOML 文件会保留其旧版默认值。例如,“生成的锁”列表中将不会包含 locks:copper_lock,除非你手动添加它或删除 locks-common.toml 以让它使用新默认值重新生成。
要求
- Minecraft 1.20.1
- Forge 47.2.0 或更高版本
- Java 17
鸣谢
这是一个非官方移植版,保留了所有原版玩法。采用 CC BY-NC 3.0 许可证,与原版模组保持一致。
Locks Reforged
An unofficial port of the Locks mod by Melonslise to Minecraft Forge 1.20.1.
Locks is a small but unique mod that lets you attach flexible, universal locks to any block in the game — including blocks from other mods. Protect your doors, chests, furnaces, and more with a dynamic locking system and an interactive lock picking minigame.
Features
Lock Any Block
Attach locks to any block — not just chests. Doors, trapdoors, furnaces, dispensers, hoppers, and modded blocks all work. Locks are spatial, so a single lock can cover multiple blocks at once.
Seven Tiers of Locks (+ Custom!)
| Tier |
Pins |
Enchantability |
Resistance |
Pick Strength |
| Wood |
5 |
15 |
4 |
0.20 |
| Copper |
6 |
16 |
8 |
0.28 |
| Iron |
7 |
14 |
12 |
0.35 |
| Gold |
6 |
22 |
6 |
0.25 |
| Steel |
9 |
12 |
20 |
0.70 |
| Diamond |
11 |
10 |
100 |
0.85 |
| Netherite |
14 |
8 |
200 |
0.95 |
- Pins — Number of pins in the lock picking minigame. More pins = harder to pick.
- Enchantability — How likely the lock is to receive powerful enchantments.
- Resistance — Explosion resistance. Diamond and Netherite locks are virtually indestructible.
- Pick Strength — How effective the matching lock pick is. Higher = better.
Netherite items are fire-resistant and survive in lava, just like vanilla netherite gear. They're crafted at a smithing table using a Netherite Upgrade Template.
All locks and lock picks are fully data-driven — add your own custom tiers via simple JSON files, or tweak existing stats through config files, TOML overrides, or datapacks. No code changes needed!
Lock Picking Minigame
Pick locks with an interactive pin-matching minigame. Match each pin to crack the combination. Higher-tier picks are more effective against tougher locks.
Lock Picks: Wood, Bobby Pin (copper), Iron, Steel, Gold, Diamond, Netherite (+ custom)
Keys & Key Rings
Craft keys that match your locks, or use a Key Ring to carry multiple keys. A Master Key opens any lock.
Seven Enchantments
- Shocking — Zaps players who fail a pick attempt (bypasses armor)
- Sturdy — Reduces pick effectiveness
- Complexity — Blocks lower-tier picks entirely
- Silent — Suppresses the rattle sound when access is denied
- Auto-Pick — Chance to instantly open the lock, bypassing the minigame
- Reinforced — Increases explosion resistance per level
- Awareness — Remembers who placed the lock; that player can open it without a key
Each enchantment can be individually enabled or disabled in the server config.
Full Protection
Locked blocks are protected from:
- Redstone activation
- Hopper extraction
- Piston movement
- Explosions
- Breaking (configurable)
Loot-Scaled Lock Generation
Lock tier is determined by the value of a chest's loot table contents. Village chests get wood or copper locks, while end city chests get gold or diamond locks. Chests with low-value loot get no lock at all.
- Multi-sample averaging — each loot table is sampled 32 times and averaged for consistent tier assignments across server restarts.
- Sub-linear stack count — item value scales with the square root of stack size, so 64 cobblestone doesn't outrank a diamond sword.
- Item value overrides — configurable per-item base values for materials like diamonds, emeralds, and netherite that are valuable but have common rarity. 15 vanilla items have sensible defaults.
- Fully configurable with per-tier value thresholds, rarity multipliers, and enchantment bonuses. Can be switched to random weighted selection if preferred.
World Integration
- Locked chests spawn naturally in structures with loot-value-scaled tiers
- Lock picks and mechanisms found in dungeon and temple loot
- Toolsmith villagers sell lock picks and mechanisms
- Wandering traders offer rare picks and enchanted locks
Adding Custom Items
Locks Reforged has a fully data-driven item system. You can add entirely new lock and lock pick tiers — or tweak existing ones — using three different methods depending on your needs.
Mechanisms
Lock mechanisms (Wood, Copper, Iron, Steel) are basic crafting components — they are not data-driven and cannot be added via config or datapack. Each lock recipe requires its corresponding mechanism as the center ingredient.
Configuration
All settings are customizable via config files. Note that locks-server.toml is per-world and lives in a different location than the other two:
config/locks-common.toml — World generation and item stats
- Generation Chance — How often locks appear on generated chests (default: 85%, only used when loot-scaled locks is disabled)
- Enchant Chance — How often generated locks are enchanted (default: 40%)
- Generated Locks / Weights — Which lock tiers appear in worldgen and their relative rarity
- Loot-Scaled Locks — Lock tier based on chest loot value (enabled by default). Configurable item values, rarity multipliers, enchantment bonuses, per-tier value thresholds, sample count, and per-item value overrides
- Lock Stats / Lockpick Stats — Per-tier stat overrides (see above)
saves/<world>/serverconfig/locks-server.toml — Server-side gameplay rules (generated per-world on first load)
- Lockable Blocks — Regex patterns for which blocks can be locked (default: chests, doors, hoppers, etc.)
- Lockable Tags — Block tags whose members can be locked
- Max Lockable Volume — Maximum blocks a single lock can cover (default: 6)
- Allow Removing Locks — Whether unlocked locks can be removed by sneaking (default: true)
- Protect Lockables — Whether locked blocks are break-proof in survival (default: true)
- Easy Lock — One-click lock placement (default: true)
- Hide Lock ID / Hide HUD Enchantments — Tooltip display options
- Enchantment Toggles — Individually enable or disable each of the 7 enchantments
- Netherite Lockpick Unbreakable — When enabled, netherite lock picks never break (default: false)
config/locks-client.toml — Client-side settings
- Deaf Mode — Visual feedback for lock picking accessibility (default: true)
Stale config files: When the mod is updated with new tiers (e.g. Copper was added after the initial release), existing TOML files keep their old defaults. For example, the "Generated Locks" list won't include locks:copper_lock unless you manually add it or delete locks-common.toml to let it regenerate with the new defaults.
Requirements
- Minecraft 1.20.1
- Forge 47.2.0 or later
- Java 17
Credits
This is an unofficial port that preserves all original gameplay. Licensed under CC BY-NC 3.0, consistent with the original mod.
评论 0
登录后参与评分
还没有评论,来抢沙发吧