
Locks Reforged
The "Locks" mod updated to work with 1.20.1; includes all features of the original with full configurability, feature expansions and some bug fixes.
- Загрузки
- 10K
- Подписчики
- 15
- Обновлён
- 18 июня 2026 г.
- Лицензия
- CC-BY-NC-4.0
Опубликован 25 марта 2026 г.
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
- Original Author: Melonslise
- Original Mod: Locks on CurseForge
- Textures: Hoonts, Artsy (ydgy)
- Sounds: freesound.org
This is an unofficial port that preserves all original gameplay. Licensed under CC BY-NC 3.0, consistent with the original mod.
Ченджлог
1.6.1Релиз1.20.1 · 18 июня 2026 г.
1.6.1
Respawning Structures Compatibility
- Added compatibility with the Respawning Structures mod (
someaddons/respawningstructures). When that mod regenerates a structure, it re-places the structure's chests and loot by replaying its structure pieces, which does not re-run biome decoration — so ourLockChestsFeaturenever fired again and respawned chests came back unlocked. Locks Reforged now re-locks the chests of a respawned structure automatically. - Implemented as a soft dependency via Respawning Structures' public
StructureRespawnEvents.AFTER_RESPAWN_EVENTcallback (wired by reflection, so there is no hard dependency and no effect when the mod is absent). After a structure respawns, stale lockables overlapping the structure footprint are cleared and the freshly placed chests are re-locked using the same rules as world generation (generation chance, loot-scaled tiers, and enchant chance), so the lock distribution matches a newly generated structure. Double chests receive a single lock spanning both halves. - Extracted the per-chest lock selection logic into a shared
LocksUtil.createChestLockable(...)helper so world generation and the respawn path stay identical; normal world-generation behavior is unchanged.
1.6.0
C2ME / Async Chunk Compatibility
- Fixed a crash (
ArrayIndexOutOfBoundsExceptioninLevelChunk) when running alongside C2ME (Concurrent Chunk Management Engine) or other mods that load/generate chunks on parallel threads (issue #10). TheLevelChunkconstructor mixin was mutating the world-global lockable handler map, registering observers, and sending packets directly from the (now off-thread) constructor, corrupting the non-thread-safe handler map. - Lockable handler mutation and packet sync from chunk and structure code paths are now funneled onto the main server thread. Without an async chunk mod this work still runs inline on the server thread, so behavior is unchanged; under C2ME it is deferred to the next server tick. A one-time log line notes when compatibility deferral first activates.
- Hardened
LootValueCalculator's value cache (now aConcurrentHashMap) against concurrent writes from world-generation worker threads, and snapshotted lockable collections before iterating in the chunk-watch and structure-copy paths to avoidConcurrentModificationException.
Shocking — Configurable Damage & Theft Punishments
- The Shocking enchantment's damage is no longer hardcoded. New server config (under Enchantments > Shocking): Shocking Damage Base (default 0.0), Shocking Damage Per Level (default 1.5), Shocking Max Damage (default 1024.0), Shocking Requires Enchantment (default true), and Shocking Cooldown Ticks (default 0). The default formula is unchanged: 1.5 damage per enchantment level when a lock pick breaks.
- New opt-in theft punishments (all default off, preserving existing behavior): Shocking Triggers On Wrong Pin, Shocking Triggers On Unauthorized Interaction (interacting with a locked block without a key), and Shocking Triggers On Block Break Attempt (trying to break a protected locked block). The original pick-break shock remains on by default. Creative players remain exempt; raising the cooldown is recommended when enabling the interaction triggers.
Configurable Trades
- Villager and wandering trader lock trades are now configurable (under Trades). Lock picks, locks, and lock mechanisms can each be toggled independently for villagers and the wandering trader, so you can disable easy lock picks while still selling locks (or vice versa).
- The lock villager profession is configurable via Villager Profession (default
minecraft:toolsmith). - Added optional, default-off early-game villager lock sales (wood/copper/iron locks at trade levels 1-3) via Enable Villager Lock Trades, so
Enable Villager Lockpick Trades = false+Enable Villager Lock Trades = trueremoves lock picks while letting players buy locks for chest protection. All existing default trades are unchanged when the config is left at defaults.
Loot-Scaled Locks (hardening + docs)
- Removed the unused Loot Value Samples config option (the loot-value estimator is deterministic, so it was never read).
- Expanded the Loot Value Tiers documentation with a worked example for making diamond/netherite locks exclusive to high-value chests. The existing system already supports this: chests below the lowest threshold get no lock, and higher loot values map to higher lock tiers.
Curios Key Ring Behavior
- A key ring worn in a Curios slot now only unlocks/relocks a lock when the player is actually aiming at the lock model, instead of toggling on any right-click of the host block. This stops a worn key ring from instantly re-locking a door or chest the moment you try to open it. Held keys, held key rings, master keys, lock picks, the Awareness enchantment, and the shift-empty-hand Curios key ring screen are unaffected.
Bug Fixes & Hardening
- Fixed a potential client
NullPointerExceptionwhen a lock-state update packet (UpdateLockablePacket) arrived while the client level was still null (world load/unload/disconnect); it now guards the level like the other lockable packets. - Fixed a lock that straddles a chunk boundary disappearing from rendering and stopping its lock/unlock sync when only one of its chunks unloaded. On chunk unload, a lockable is now kept in the handler until none of the chunks it occupies remain loaded.
- Capability providers now invalidate their
LazyOptionalwhen detached (chunk/level unload, player logout), following the standard Forge pattern. - Minor cleanup in
Cuboid6i.containedChunksTo(append instead of index-insert) and an aligned fastutil default-value check inUpdateLockablePacket.
1.5.2Релиз1.20.1 · 15 мая 2026 г.
1.5.4
Bug Fixes
- Fixed a ghost lockpick briefly appearing at the insertion depth when a pick broke at the far end of a long lock (netherite and other 13+ pin locks).
LockPickingScreen.updatePickParts()did not clamp the right fragment's texture width, so on long locks the UV overflowed the pick atlas and the edge-clamped sample rendered as a full pick silhouette behind the breaking pieces. The right fragment now clips to the atlas and follows the pick's actual insertion position.
1.5.3
Bug Fixes
- Fixed inability to place locks on containers in Adventure gamemode. Vanilla's
ItemStack.useOn()short-circuits whenmayBuildis false, which preventedLockItem.useOn()from ever firing. Lock placement now falls back to theRightClickBlockevent handler when sneak-clicking with a lock item in Adventure mode, matching how picking, relocking, and pickup already worked.
1.5.2
Bug Fixes
- Fixed keys, master keys, key rings, Awareness enchantment, and curio key rings being unable to re-lock unlocked lockables. The toggle logic only ran when at least one lockable was locked; unlocking all lockables at a position made re-locking impossible in all game modes.
- Fixed
NullPointerExceptioncrash inStructureTemplateMixinwhen the lockable handler capability is missing during structure copy or paste operations. - Fixed
Lock.fromBufcreating an all-zero pin combo on the client instead of generating a proper dummy combo from the lock's ID seed. - Fixed
KeyRingInventory.extractItemusinggetMaxStackSize()instead ofgetCount()as the extraction limit, violating theIItemHandlercontract. - Fixed
Transform.fromDirectionAndFacereturning null for unmapped direction/face combinations, which could causeNullPointerExceptionin lock state calculations. Now falls back toNORTH_MID. - Fixed
LockItem.isOpen()callinggetOrCreateTag()on read, which unnecessarily created empty NBT tags on items without existing data.
Loot-Scaled Lock Generation
- Chests whose loot value falls below all configured tier thresholds no longer receive a lock when loot-scaled locks are enabled. Previously, these low-value chests always received a wood lock despite the config description stating otherwise.
New Config
- Added Loot Table Injection Patterns server config option. Controls which loot tables receive lock pick and key loot injection. Default:
minecraft:chests/. Add entries likesome_mod:chests/to inject into modded dungeon chests.
Security
- Added additional server-side validation to lock picking packets: the server now re-checks that the lock is still locked and the player still holds a valid pick before processing each pin attempt.
Misc
- Invalid entries in the
Lockable Tagsconfig list now log a warning instead of being silently skipped.
1.5.0
Generation Chance
- Re-enabled the
Generation Chanceconfig setting. In 1.4.4 this was disabled and all generated chests received a lock unconditionally. It is now a functional setting again (default 1.0). Lowering it allows a percentage of generated chests to skip lock placement.
Bug Fixes
- Fixed lock picking GUI showing garbled textures when a lockpick breaks. The broken pick halves were being rendered with the lock body texture atlas (48x80) instead of the lockpick texture atlas (160x16), causing completely wrong UV sampling.
- Fixed the left broken pick piece's fade animation targeting the wrong sprite (right piece instead of left piece).
- Fixed adjacent Lootr chests not all receiving locks. When two Lootr single chests were next to each other, Minecraft auto-connected them as a double chest (
LEFT/RIGHT), and theRIGHThalf was filtered out before lock placement could run.
1.4.8
Security
- Lock pin combinations are no longer sent to clients over the network. The server now only transmits the pin count; pin validation remains fully server-authoritative. Previously, the full combo was readable from packets, trivially bypassing the lock picking minigame.
- Network version predicates now enforce strict version matching. Clients and servers with mismatched mod versions are cleanly rejected instead of silently connecting with incompatible packet formats.
- Server-to-client pin attempt packets are now range-validated, rejecting out-of-bounds pin indices.
Bug Fixes
- Fixed locks failing to render on multiplayer clients when the server's
Max Lockable Volumeconfig exceeded the default value. Client-side packet handling no longer re-runs volume/intersection validation that only the server should perform. - Fixed potential client crash (
NullPointerException) when lock packets arrive during dimension transitions or disconnect, before the client level is initialized. - Fixed potential server crash (
NullPointerException) when removing a lockable whose bounding box spans a chunk that has already been unloaded. Unloaded chunks are now skipped gracefully. - Fixed lock-close sound playing to nearby players even when lock placement fails server-side validation (e.g. overlapping an existing lock). Sound now plays only after successful placement.
- Fixed the key crafting recipe consuming all key blanks in the grid but producing only one key. The recipe now accepts exactly one blank per craft.
- Fixed worldgen lock placement only registering in the first chunk when a double chest spans a chunk boundary. All intersecting proto-chunks now receive the lockable.
- Fixed potential
ArrayIndexOutOfBoundsExceptionwhen loading lockables with corrupted or out-of-range transform data from NBT. Invalid indices now fall back to the default transform. - Fixed lock picking GUI springs not animating when pins move (regression from 1.4.2 rendering migration).
Textures
- Changed the Netherite Lock Pick texture.
- Fixed the unlocked Netherite Lock texture.
- Darkened the Netherite lock mechanism texture.
Cleanup
- Removed dead code: unused
LocksCapabilities.registerCaps(),LocksConfig.canGen(),WrittenBookItemimport, and commented-out code blocks acrossLock,Cuboid6i,LockPickingContainer, andLocksClientUtil.
1.4.4
Guaranteed Lock Generation
- All generated chests with loot tables now receive a lock. Chests that previously fell below the lowest loot value threshold (or failed the 85% generation chance roll) now get a wooden lock instead of no lock at all.
- The
Generation Chanceconfig setting is no longer used — all generated chests are locked unconditionally. The setting is kept in the config file for backwards compatibility.
1.4.3
Bug Fixes
- Fixed locked chest generation being restricted to overworld biomes. Structure chests can now generate locks in the nether, the end, and modded dimensions as well.
1.4.2
Netherite Lock Pick
- Netherite lock picks now use durability instead of being consumed outright when a failed pin attempt triggers a break.
- Added 128 durability to the Netherite Lock Pick.
- Netherite lock picks can now be repaired with Netherite Ingots in an anvil.
- Netherite lock picks can now receive Mending.
- Netherite Lockpick Unbreakable now prevents durability loss entirely instead of only preventing the item from being deleted.
Bug Fixes
- Fixed loot-scaled lock generation causing massive startup logspam from sampled loot functions such as invalid
SetItemDamageFunctionrolls on non-damageable items. - Fixed loot-scaled lock generation crashing some modpacks by invoking loot-table behavior that performed structure lookups, world generation, or block-state access during startup/off-thread precomputation.
- Reworked loot value calculation to estimate chest value directly from loot table JSON data instead of executing live loot generation.
- When a chest loot table cannot be estimated safely, lock generation now falls back to the old random weighted system instead of failing or crashing world load.
1.4.1
Bug Fixes
- Fixed locks not generating on chests during initial world creation. The async loot value pre-computation introduced in v1.4.0 left the cache empty during spawn area generation, causing all chests to receive no locks. Now falls back to random weighted lock selection while pre-computation runs in the background.
1.4.0Релиз1.20.1 · 25 марта 2026 г.
1.4.0
Netherite Lock & Lock Pick
- Added Netherite Lock — the strongest lock tier with 14 pins, 200 explosion resistance, and 8 enchantability. Crafted at a smithing table from a Diamond Lock + Netherite Ingot + Netherite Upgrade Template.
- Added Netherite Lock Pick — strength 0.95, making it nearly unbreakable. Crafted at a smithing table from a Diamond Lock Pick + Netherite Ingot + Netherite Upgrade Template.
- Both netherite items are fire-resistant and survive in lava, like vanilla netherite gear.
- Added Netherite Lockpick Unbreakable server config option (off by default). When enabled, netherite lock picks never break during lock picking.
- Netherite lock picks are sold by level 5 toolsmith villagers (16 emeralds). Enchanted netherite locks are offered by wandering traders (40 emeralds).
- Added to loot-scaled lock generation with a value threshold of 60.0 (the highest tier).
Awareness Enchantment
- Added Awareness enchantment (max level I, very rare). When an Awareness-enchanted lock is placed, it remembers who placed it. That player can open and re-lock it with a bare hand — no key needed.
- Works with overlapping locks: each lock independently tracks its owner, so multiple players' Awareness locks at the same position each work correctly.
- Configurable via Enable Awareness toggle in the server config (on by default).
- Shows "Aware (Owner-Bound)" tooltip on locks that have an owner.
New Config
- Added Netherite Lock stat overrides (Length, Enchantment Value, Resistance) in the common config.
- Added Netherite Lockpick Strength override in the common config.
- Added Netherite Lockpick Unbreakable toggle in the server config.
- Added Enable Awareness enchantment toggle in the server config.
Bug Fixes
- Fixed world loading hang in modpacks caused by synchronous loot table pre-computation blocking the server thread. Loot values are now computed asynchronously on a background thread. Chests generated before pre-computation finishes gracefully fall back to no lock.
- Fixed lockpicking GUI rendering corruption (textures smeared/repeated vertically) when using rendering optimization mods like ImmediatelyFast or Embeddium. Migrated all lockpicking screen rendering from raw Tesselator calls to
GuiGraphics.blit(), which optimization mods handle correctly. - Fixed potential
IndexOutOfBoundsExceptioncrash in lock generation if the "Generated Lock Chances" config list was shorter than the "Generated Locks" list (e.g. from manual config editing). Now uses safe bounds checking with a warning log. - Fixed potential crash in random lock generation if the weighted lock map was empty (e.g. all weights set to 0).
- Major Texture Fix.
Комментарии
Загружаем…