Viper Private Chests
适用于 Fabric 服务器的容器保护方案。使用原版告示牌锁定箱子、 barrel、潜影盒等更多方块,无需安装客户端模组。
Viper Private Chests 通过尽可能简单的系统来保护服务器上的容器:一个告示牌。在容器上放置一个墙壁告示牌,在第一行写入 [private],该容器即被锁定为你所有。其他玩家无法打开它、破坏它、用漏斗偷取其中的物品或将其炸毁。所有功能均在服务端运行,因此原版 Java 玩家以及 Geyser / Floodgate 的基岩版玩家无需安装任何内容即可受到保护。
模组功能
- 使用告示牌锁定容器。在连接容器的告示牌上写入
[private] 或 [public] 即可创建持久锁。破坏告示牌会移除锁定,使得防护完全可见且直观。
- 精确控制谁能打开什么。在剩余的告示牌行中添加玩家名称(逗号分隔)、计分板队伍(
team:Red)或你的全局信任列表([trusted])。
- 提供公共容器模式。
[public] 用于开放访问,[deposit] 用于仅限投入的捐赠箱,以及 [display] 用于只读展示柜。
- 阻止漏斗盗窃。除非告示牌带有
[hopper] 修饰符,否则漏斗和漏斗矿车无法从锁定容器中拉出物品或向其推送物品。
- 抵御爆炸。锁定容器及其告示牌会被过滤出爆炸伤害范围,因此 TNT、苦力怕、凋灵和其他爆炸无法摧毁它们。
- 防止通过相邻方块绕过锁定。非所有者不能在你的锁定箱子旁边放置箱子以合并进入其中,也不能用自己的告示牌覆盖你的锁定。
- 向所有者发出入侵警报。失败的访问尝试会播放锁定音效、显示操作栏警告、记录到每个锁定的审计日志中,并且可以选择闪烁附近的红石线和灯以触发报警电路。
- 随时间自我管理。如果所有者不活跃,锁定可以过期(所有权衰减);当所有者被封禁时,保护将停止;对于已销毁容器的过时记录可以通过一条命令清除。
- 赋予管理员全面监控权限。交互式游戏内 GUI 列出所有锁定,羽毛检查工具显示锁定详情及访问历史,强制解锁支持按坐标操作。
- 数据与世界存档一起存储。所有锁定、信任列表和审计历史都随世界存档保存,因此备份也会携带你的保护数据。
受保护的容器
箱子、陷阱箱、 barrel、潜影盒、制造台、发射器、投掷器和雕刻书架。双格箱子被视为一个整体:锁定其中一半即可保护整个箱子。
如何锁定容器
- 放置一个容器(箱子、barrel、潜影盒等)。
- 直接在容器上放置一个墙壁告示牌。
- 在第 1 行写入
[private]。
- 可选地,在第 2 至 4 行使用成员名称、
team:TeamName 或 [trusted] 标记。
- 完成。当你完成编辑告示牌的那一刻,容器即被锁定。
要解锁,只需破坏告示牌即可。要更改谁有访问权限,请编辑告示牌行并再次完成编辑。
告示牌标记
| 行内容 |
效果 |
[private] |
第 1 行的私有锁定。只有所有者和白名单玩家可以打开容器。 |
[public] |
第 1 行的公共锁定。所有人都可以打开容器。 |
[deposit] |
与 [public] 一起使用。任何人都可以放入物品,但只有所有者和白名单玩家可以取出物品。非常适合捐赠箱和付款箱。 |
[display] |
与 [public] 一起使用。任何人都可以查看内部,但除了所有者外没有人可以取出物品。非常适合展示柜和奖品展示。 |
[trusted] |
授予所有者全局信任列表上所有人的访问权限(通过 /pchests trust 管理)。 |
[redstone] |
允许红石比较器和相关自动化读取容器。 |
[hopper] |
允许漏斗和漏斗矿车移动物品的进出容器。 |
team:<name> |
授予原版计分板队伍每个成员的访问权限,例如 team:Red。 |
<player names> |
任何其他文本都被视为玩家名称。用逗号分隔多个名称,例如 Steve, Alex。 |
标记匹配不区分大小写,因此 [Private] 与 [private] 效果相同。
玩家命令 (/pchests)
所有玩家均可使用。无需权限等级。
| 命令 |
描述 |
/pchests trust add <player> |
将玩家添加到你的全局信任列表中。此列表中的任何人都可以打开其告示牌带有 [trusted] 标记的你的容器。 |
/pchests trust remove <player> |
从你的全局信任列表中移除玩家。 |
/pchests trust list |
显示当前在你信任列表中的所有人。 |
/pchests autolock |
切换自动锁定模式。启用后,你放置的容器会自动锁定为你所有的私有容器,这样你就永远不会忘记保护新箱子。再次运行以禁用。 |
管理员命令 (/private_chests)
需要配置文件中的管理员权限等级(默认为 OP 等级 3)。list 和 list_in_area 命令会打开交互式 GUI;其余命令在聊天中回复。
| 命令 |
描述 |
/private_chests list |
打开一个交互式 GUI,列出服务器上所有受保护的容器。 |
/private_chests list private |
相同的 GUI,仅筛选私有锁。 |
/private_chests list public |
相同的 GUI,仅筛选公共锁。 |
/private_chests list_in_area <radius> |
打开 GUI,仅列出你当前位置周围指定半径(1 到 500 格)内的锁。 |
/private_chests list_in_area <radius> private |
按区域筛选的 GUI,仅显示私有锁。 |
/private_chests list_in_area <radius> public |
按区域筛选的 GUI,仅显示公共锁。 |
/private_chests info <x> <y> <z> |
打印该坐标处锁的完整详情:所有者、类型、位置、团队、信任模式、漏斗和红石标志、允许的玩家、创建日期以及最近 25 条审计日志条目(谁访问或被拒绝,以及时间)。 |
/private_chests unlock <x> <y> <z> |
强制移除该坐标处的锁,例如当所有者退出服务器时。前所有者名称会在聊天中确认。 |
/private_chests cleanup |
扫描每个锁记录并删除那些方块现在是空气或不再是可保护容器的条目,然后报告移除了多少过期记录。 |
管理员还可以通过放置自己的 [private] 或 [public] 告示牌来覆盖其他玩家的锁,这对于恢复不活跃玩家的容器非常有用。
检查工具
持有配置的检查物品(默认为羽毛)的管理员可以右键点击任何上锁的容器,立即在聊天中看到其所有者、锁类型、团队、信任模式、漏斗标志和最近的审计历史。通过 inspectionItem 配置项更改该物品。
配置
配置文件在首次启动时创建,位于 config/private-chests.json。删除它并重启以重新生成默认值。
| 选项 |
默认值 |
描述 |
floodgatePrefix |
"." |
用于识别 Geyser / Floodgate 基岩版玩家的用户名前缀,以便信任列表和成员名称也适用于他们。 |
adminPermissionLevel |
3 |
执行 /private_chests 管理命令、使用检查工具以及覆盖其他玩家锁所需的最小 OP 权限等级。 |
maxLocksPerPlayer |
0 |
每个玩家最多可以拥有的上锁容器数量。0 表示无限制。达到限制的玩家在尝试锁定另一个容器时会收到提示。 |
listMaxEntries |
50 |
管理员列表 GUI 中显示的最大锁数量。 |
listPreviewEntries |
20 |
管理员列表 GUI 使用的预览条目数量。 |
disableProtectionIfOwnerBanned |
true |
如果为 true,当所有者被服务器封禁时,容器将不再受保护。 |
enableClaimDecay |
true |
如果为 true,当所有者在配置的天数内不活跃时,锁会自动过期,从而释放旧的领地。 |
daysBeforeClaimDecay |
30 |
启用领地衰减后,所有者不活跃多少天后锁会失效。 |
inspectionItem |
"minecraft:feather" |
管理员用于检查上锁容器详情和审计历史的右键点击物品 ID。 |
enableSoundFeedback |
true |
如果为 true,被拒绝访问的玩家会听到上锁箱子的声音。 |
enableActionBarAlerts |
true |
如果为 true,模组会在创建锁、拒绝访问和其他反馈时发送动作栏消息。关闭以获得更安静的体验。 |
maxHistoryLogEntries |
25 |
每个锁保留的审计日志条目数量,由 /private_chests info 和检查工具显示。 |
allowIntruderRedstonePulse |
true |
如果为 true,失败的访问尝试会短暂触发相邻的红石线和灯,这样你就可以为你的容器连接警报、灯光或陷阱。 |
安装
- 为你的 Minecraft 版本安装 Fabric Loader(Minecraft 1.21.x、26.1.x 和 26.2.x 需要 0.19.3 或更高版本;26.3 需要 0.19.5 或更高版本)和 Fabric API。
- 从 Versions 页面下载与你的 Minecraft 版本匹配的 Viper Private Chests jar 文件。
- 将 jar 文件放入服务器的
mods 文件夹。玩家客户端不需要安装此模组。
- 启动服务器。配置文件会在首次运行时自动生成。
此模组也适用于单人游戏:将其与 Fabric Loader 和 Fabric API 一起安装到你的客户端配置文件中,你自己的世界也会受到同样的保护。
要求
| Minecraft |
Fabric Loader |
Fabric API |
Java |
| 1.21 至 1.21.11 |
0.19.3+ |
0.141.x |
21+ |
| 26.1 至 26.1.2 |
0.19.3+ |
0.145.x |
25+ |
| 26.2 |
0.19.3+ |
0.154.x |
25+ |
| 26.3 |
0.19.5+ |
0.161.x |
25+ |
请确保下载专为你的确切 Minecraft 版本构建的 jar:26.1.x jar 涵盖 26.1 到 26.1.2,而 26.2 和 26.3 各自拥有独立的 jar。
须知
- 此模组完全在服务端运行:原版客户端看到正常的告示牌和正常的容器,且支持通过 Geyser / Floodgate 连接的基岩版玩家。
- 告示牌保持可读和可编辑状态,因此成员、团队和修饰符可以随时通过编辑告示牌进行更改。
- 每次打开、被拒尝试和锁更改都会针对每个容器进行记录,并由管理员查看,这使得反破坏调查变得简单直接。
Viper Private Chests
Server-side container protection for Fabric servers. Lock chests, barrels, shulkers and more with plain vanilla signs. No client mod required.
Viper Private Chests protects containers on your server using the simplest system possible: a sign. Place a wall sign on a container, write [private] on the first line, and the container is locked to you. Other players cannot open it, break it, steal from it with hoppers, or blow it up. Everything runs 100 percent on the server, so vanilla Java players and Geyser / Floodgate Bedrock players are protected without installing anything.
What the mod does
- Locks containers with signs. Writing
[private] or [public] on a sign attached to a container creates a persistent lock. Breaking the sign removes the lock, so protection is fully visible and intuitive.
- Controls exactly who can open what. Add player names, comma separated name lists, scoreboard teams (
team:Red), or your global trust list ([trusted]) on the remaining sign lines.
- Offers public container modes.
[public] for open access, [deposit] for drop-only donation boxes, and [display] for read-only showcases.
- Blocks hopper theft. Hoppers and hopper minecarts cannot pull items out of, or push items into, a locked container unless the sign carries the
[hopper] modifier.
- Survives explosions. Locked containers and their signs are filtered out of explosion damage, so TNT, creepers, withers and other blasts cannot destroy them.
- Prevents lock bypass by adjacency. Non-owners cannot place a chest next to your locked chest to merge into it, and non-owners cannot overwrite your lock with their own sign.
- Alerts you to intruders. Failed access attempts play a locked sound, show an action bar warning, are written to a per-lock audit log, and can optionally flash nearby redstone wire and lamps so alarm circuits trigger.
- Manages itself over time. Locks can expire after owner inactivity (claim decay), stop protecting when the owner is banned, and stale records for destroyed containers can be purged with one command.
- Gives admins full oversight. An interactive in-game GUI lists every lock, a feather inspection tool shows lock details plus access history, and force-unlock works by coordinates.
- Stores data with the world. All locks, trust lists and audit history are saved alongside the world save, so backups carry your protection data with them.
Protected containers
Chests, trapped chests, barrels, shulker boxes, crafters, dispensers, droppers and chiseled bookshelves. Double chests are handled as one unit: locking either half protects the whole chest.
How to lock a container
- Place a container (chest, barrel, shulker box, and so on).
- Place a wall sign directly onto the container.
- Write
[private] on line 1.
- Optionally, use lines 2 to 4 for member names,
team:TeamName, or the [trusted] marker.
- Done. The container is locked the moment you finish editing the sign.
To unlock, simply break the sign. To change who has access, edit the sign lines and finish editing again.
Sign markers
| Line content |
Effect |
[private] |
Private lock on line 1. Only the owner and whitelisted players can open the container. |
[public] |
Public lock on line 1. Everyone can open the container. |
[deposit] |
Use together with [public]. Anyone can insert items but only the owner and whitelisted players can take items out. Ideal for donation boxes and payment chests. |
[display] |
Use together with [public]. Anyone can look inside but nobody except the owner can take items out. Ideal for showcases and prize displays. |
[trusted] |
Grants access to everyone on the owner's global trust list (managed with /pchests trust). |
[redstone] |
Allows redstone comparators and related automation to read the container. |
[hopper] |
Allows hoppers and hopper minecarts to move items in and out of the container. |
team:<name> |
Grants access to every member of a vanilla scoreboard team, for example team:Red. |
<player names> |
Any other text is treated as player names. Separate multiple names with commas, for example Steve, Alex. |
Marker matching is case insensitive, so [Private] works the same as [private].
Player commands (/pchests)
Every player can use these. No permission level required.
| Command |
Description |
/pchests trust add <player> |
Adds a player to your global trusted list. Anyone on this list can open your containers whose signs carry the [trusted] marker. |
/pchests trust remove <player> |
Removes a player from your global trusted list. |
/pchests trust list |
Shows everyone currently on your trusted list. |
/pchests autolock |
Toggles auto-lock mode. While enabled, containers you place are automatically locked to you as private, so you never forget to protect a new chest. Run it again to disable. |
Admin commands (/private_chests)
Requires the admin permission level from the config (OP level 3 by default). The list and list_in_area commands open an interactive GUI; the rest answer in chat.
| Command |
Description |
/private_chests list |
Opens an interactive GUI listing every protected container on the server. |
/private_chests list private |
Same GUI, filtered to private locks only. |
/private_chests list public |
Same GUI, filtered to public locks only. |
/private_chests list_in_area <radius> |
Opens the GUI listing only locks within the given radius (1 to 500 blocks) around your position. |
/private_chests list_in_area <radius> private |
Area-filtered GUI showing private locks only. |
/private_chests list_in_area <radius> public |
Area-filtered GUI showing public locks only. |
/private_chests info <x> <y> <z> |
Prints full details for the lock at those coordinates: owner, type, position, team, trusted mode, hopper and redstone flags, allowed players, creation date, and the last 25 audit log entries (who accessed or was denied, and when). |
/private_chests unlock <x> <y> <z> |
Force-removes the lock at those coordinates, for example when the owner quit the server. The previous owner name is confirmed in chat. |
/private_chests cleanup |
Scans every lock record and deletes entries whose block is now air or is no longer a protectable container, then reports how many stale records were removed. |
Admins can also overwrite another player's lock by placing their own [private] or [public] sign, which is useful for recovering containers of inactive players.
Inspection tool
Admins holding the configured inspection item (a feather by default) can right-click any locked container to immediately see its owner, lock type, team, trusted mode, hopper flag, and recent audit history in chat. Change the item with the inspectionItem config option.
Configuration
The config file is created on first startup at config/private-chests.json. Delete it and restart to regenerate defaults.
| Option |
Default |
Description |
floodgatePrefix |
"." |
Username prefix used to recognize Geyser / Floodgate Bedrock players, so trust lists and member names work for them too. |
adminPermissionLevel |
3 |
Minimum OP permission level required for /private_chests admin commands, the inspection tool, and overwriting other players' locks. |
maxLocksPerPlayer |
0 |
Maximum number of locked containers each player may own. 0 means unlimited. Players who reach the limit are told so when they try to lock another container. |
listMaxEntries |
50 |
Maximum number of locks shown in the admin list GUI. |
listPreviewEntries |
20 |
Number of preview entries used by the admin list GUI. |
disableProtectionIfOwnerBanned |
true |
When true, containers stop being protected if their owner is banned from the server. |
enableClaimDecay |
true |
When true, locks expire automatically after the owner has been inactive for the configured number of days, freeing up old claims. |
daysBeforeClaimDecay |
30 |
Days of owner inactivity after which a lock decays when claim decay is enabled. |
inspectionItem |
"minecraft:feather" |
Item ID admins right-click with to inspect a locked container's details and audit history. |
enableSoundFeedback |
true |
When true, players who are denied access hear the locked-chest sound. |
enableActionBarAlerts |
true |
When true, the mod sends action bar messages for lock creation, denied access, and other feedback. Turn off for a quieter experience. |
maxHistoryLogEntries |
25 |
Number of audit log entries kept per lock and shown by /private_chests info and the inspection tool. |
allowIntruderRedstonePulse |
true |
When true, a failed access attempt briefly triggers adjacent redstone wire and lamps, so you can wire alarms, lights, or traps to your containers. |
Installation
- Install Fabric Loader (0.19.3 or newer for Minecraft 1.21.x, 26.1.x and 26.2.x; 0.19.5 or newer for 26.3) and Fabric API for your Minecraft version.
- Download the Viper Private Chests jar that matches your Minecraft version from the Versions page.
- Put the jar into the server's
mods folder. No mod is needed on players' clients.
- Start the server. The config file is generated automatically on first run.
The mod works in singleplayer too: install it in your client profile together with Fabric Loader and Fabric API and your own world is protected the same way.
Requirements
| Minecraft |
Fabric Loader |
Fabric API |
Java |
| 1.21 through 1.21.11 |
0.19.3+ |
0.141.x |
21+ |
| 26.1 through 26.1.2 |
0.19.3+ |
0.145.x |
25+ |
| 26.2 |
0.19.3+ |
0.154.x |
25+ |
| 26.3 |
0.19.5+ |
0.161.x |
25+ |
Make sure to download the jar built for your exact Minecraft line: the 26.1.x jar covers 26.1 to 26.1.2, while 26.2 and 26.3 each have their own jar.
Good to know
- The mod is fully server-side: vanilla clients see normal signs and normal containers, and Bedrock players through Geyser / Floodgate are supported.
- Signs stay readable and editable, so members, teams and modifiers can be changed at any time by editing the sign.
- Every open, denied attempt and lock change is recorded per container and viewable by admins, which makes griefing investigations straightforward.
评论 0
登录后参与评分
还没有评论,来抢沙发吧