Traveler's Chest
属于 Traveler's 系列。Traveler's Chest 会生成一个在玩家从中取物后自动补满的箱子:为所有人提供战利品和冒险点数——玩家按需取用,且在首次取物后的一个冷却时间结束后,箱子会以相同的物品和相同的格子位置重新填满。
功能
- 玩家在首次从箱中取物后经过一个冷却时间,箱子便会补满,每个已保存的物品堆回到其对应的格子
- 所有人都像操作普通箱子一样从同一个箱子中取物
- 只有玩家能取出物品:漏斗、漏斗矿车、发射器和铜傀儡无法从 Traveler's Chest 中提取或向其推送物品
- 只有管理员(operators)可以破坏 Traveler's Chest:包括单个箱子、陷阱箱、铜箱以及双箱子的任意一半
- 爆炸、凋灵和末影龙不会破坏 Traveler's Chest
- 在所有支持版本的管理员界面均提供箱子菜单:
/chests
- 仅服务端运行:玩家无需安装客户端模组
一个 jar 文件适用于 Minecraft 1.20 至 1.20.4、1.21 至 1.21.11 以及 26.1 至 26.3。Fabric 会根据你的服务器加载匹配的构建版本,因此当服务器切换到其他受支持版本时,仍可使用同一个 jar 文件。它需要 Fabric Loader 0.16.10 或更高版本以及 Fabric API。不支持 Minecraft 1.20.5 和 1.20.6。
从 1.2.x 升级会保留所有的 Traveler's Chest 及其中的物品。
安装
- 在运行受支持 Minecraft 版本的服务器上安装 Fabric Loader 和 Fabric API。
- 从 发布页面 下载最新版本的 Traveler's Chest。一个 jar 文件涵盖所有支持的 Minecraft 版本。
- 将
.jar 文件放入服务器的 mods 文件夹。
- 启动服务器以生成配置文件。
配置
配置文件
-
config/travelers-chest/travelers_chest_config.txt
- 示例内容:
debug_logging=false
- 启用或禁用调试日志记录,以便进行详细故障排除。
-
config/travelers-chest/chests.json
- 按维度、位置存储每个 Traveler's Chest 的信息,包括其中的物品、冷却时间和名称。该模组会管理此文件,请勿手动编辑。
- 如果无法读取该文件,模组会在能够读取之前不保存任何内容并提示错误,而不是覆盖原文件。其上一个版本会作为
chests.json.bak 保存在旁边。
-
config/travelers-chest/travelers_chests.json
- 2.0.0 之前的版本在此处保存箱子数据。2.0.0 会导入一次该文件并保留原样,因此回退到旧版发布时仍能找到你的箱子。导入的箱子在首次加载且发现未满时开始计算冷却时间。
使用方法
- 放置一个箱子(单个或双个),并将物品放入其中。
- 面对箱子并执行
/travelers_chest create,或者执行 /chests 然后点击“Add the chest I'm facing”。
- 玩家打开箱子并按需取物,就像操作普通箱子一样。
- 在首次取物后的一个冷却时间结束后,箱子补满:每个已保存的物品堆回到其对应的格子,其他格子保持不变。直到有人从中取物前,不会启动任何冷却计时。
- 补满发生在有人下次打开双箱子的任意一半时,或其所在区块加载时,因此不会因为检查箱子而单独加载区块。
命令
管理员(权限等级 4)在面对箱子且距离不超过 20 格时使用以下命令:
/chests:打开箱子菜单。面对 Traveler's Chest 时,会打开该箱子的菜单;在其他位置,则显示所有 Traveler's Chest 的列表。
/travelers_chest create [time]:将其设置为 Traveler's Chest,使用当前箱内物品进行补满,冷却时间为秒数(默认值:1800,即半小时)。
/travelers_chest edit <time>:更改其冷却时间。如果箱子内有物品,则当前箱内物品将成为补满时的物品。
/travelers_chest destroy:将其恢复为普通箱子。箱内物品保留不变。
箱子功能
- 补满机制:箱子在玩家首次从中取物后的一个冷却时间结束时会补满,而非固定周期触发。只要格子中包含除已保存堆叠以外的任何内容(包括附魔和耐久度损坏),该格子就会被视为需要补满。
- 共享内容:所有人都像操作普通箱子一样从同一个箱子中取物。
- 仅限玩家:漏斗、漏斗矿车、发射器和铜傀儡无法从 Traveler's Chest 中提取或向其推送物品,因此旁边的比较器读数为 0。
- 双箱子支持:打开双箱子的任意一半即可触发补满。
- 受保护的箱子:只有管理员可以破坏 Traveler's Chest,包括双箱子的任意一半。爆炸会使 Traveler's Chest 及其中的物品完好无损,而其周围的方块会正常破坏:TNT、苦力怕、末影水晶、床、重生锚、火球和凋灵头颅。凋灵和末影龙会穿过它而不破坏它,紧贴单个箱子放置的箱子仍保持为单个箱子,因此 Traveler's Chest 保留自己的格子。陷阱箱也可以成为 Traveler's Chest,并以相同方式受到保护。来自 Minecraft 1.21.9 的铜箱也可以成为 Traveler's Chest:它在氧化过程中保留物品、名称和补满效果,铜傀儡也不会从其内部取走任何东西。
/chests 打开基于游戏自身箱子界面构建的菜单,因此在所有受支持版本中均可正常工作:
- 面对一个旅行者箱子时,它会打开该箱子的菜单:用于冷却时间的时钟(左键点击增加 10 分钟,右键点击减少 10 分钟;当剩余时间为 10 分钟及以下时,每次调整 1 分钟,最低至 1 分钟;Shift+点击则调整 1 小时)、打开箱子、立即补充、传送至此处、重命名以及转换为普通箱子。
- 在其它位置,它会列出服务器上的所有旅行者箱子。悬停在一个箱子上可查看其初始物品、位置、冷却时间以及是否已满或何时补充;点击它即可打开其菜单。青绿染料“添加我面前的箱子”会打开一个铁砧来为你面对的那个箱子命名,新创建的旅行者箱子初始冷却时间为 30 分钟。
- “打开箱子”可从任何地方打开箱子本身,并首先进行补充。像操作箱子一样移动物品的进出。返回按钮位于单个箱子的行下方,或者按 Esc 返回到箱子的菜单;如果是双格箱子则会占满屏幕,因此标题显示为“按 Esc 返回”。在做出更改后返回时会询问是否保存物品:“保存物品”将使箱子从此以这些物品进行补充,而关闭该询问则保留旧物品。
- “重命名”会打开一个包含当前名称的铁砧。名称会被写入箱子本体,包括双格箱子的两半,因此玩家会将其视为箱子的标题。空箱子会保留当前名称。
- 方块已消失的箱子会在列表中显示为已消失,并提供“从列表中移除”选项。
每个按钮在执行操作前都会再次检查操作者等级,因此只有操作者才能更改任何内容。



调试日志
在 config/travelers-chest/travelers_chest_config.txt 中启用调试日志,以获取模组操作的详细日志,例如箱子补充和新旅行者箱子的创建:
debug_logging=true
日志将输出到服务器控制台。2.0.0 版本之前的发布版在一个不存在的文件夹中寻找此文件,因此无法开启调试日志。
JSON 结构
箱子存储在 chests.json(格式 2)中,具有以下架构,每个条目对应一个箱子:
- dimension: 箱子所在的维度
- pos: 箱子的位置,表示为 x、y 和 z
- double: 是否为双格箱子
- name: 在菜单中给出的名称(如果有)
- wait: 冷却时间(秒)
- takenAt: 第一次取走物品时的世界时间(以刻为单位);仅在冷却期间存在
- items: 保存的物品堆栈,每个堆栈包含其 slot(槽位)、dataVersion(保存时的 Minecraft 数据版本)以及以 SNBT 文本表示的 item
每个堆栈在读取时都会由 Minecraft 自身的物品升级功能更新,因此升级到新版 Minecraft 的世界会保留其箱子。箱子上可能出现两个标志:unchecked(表示尚未加载的导入箱子)和 gone(表示其方块缺失)。
示例:
{
"format": 2,
"chests": [
{
"dimension": "minecraft:overworld",
"pos": [-4, -60, -12],
"double": true,
"name": "Supply Cache",
"wait": 1800,
"takenAt": 291,
"items": [
{"slot": 0, "dataVersion": 3955, "item": "{id:\"minecraft:torch\",count:8}"},
{"slot": 30, "dataVersion": 3955, "item": "{id:\"minecraft:bread\",count:16}"}
]
}
]
}
travelers_chests.json(1.2.x 版本的文件)仅导入一次并保持原样。如果在此期间有较旧的发布版运行并修改了它,2.0.0 版本会再次导入它。
支持
为了支持 Traveler's Chest 的开发,请加入 GBTI Network 以获取以下资源:
其他贡献方式
链接
许可证
本项目采用 GNU General Public License v3.0 许可。有关详细信息,请参阅 LICENSE 文件。
Traveler's Chest
Part of the Traveler's Series. Traveler's Chest makes a chest that refills itself after players take from it. Stock loot spots and adventure points for everyone: players take what they need, and one cooldown after the first take the chest refills with the same items in the same slots.
Features
- The chest refills one cooldown after a player first takes from it, with each saved stack back in its slot
- Everyone takes from the same chest, as from any chest
- Only players take items: hoppers, hopper minecarts, droppers and copper golems cannot pull from or push into a Traveler's Chest
- Only operators can break a Traveler's Chest: single, trapped, copper, or either half of a double chest
- Explosions, withers and the ender dragon leave a Traveler's Chest standing
- Chest menus for operators on every supported version:
/chests
- Server-side only: players need no client mod
One jar runs on Minecraft 1.20 to 1.20.4, 1.21 to 1.21.11 and 26.1 to 26.3. Fabric loads the build that matches your server, so a server that moves to another supported version keeps the same jar. It needs Fabric Loader 0.16.10 or newer and Fabric API. Minecraft 1.20.5 and 1.20.6 are not supported.
Upgrading from 1.2.x keeps every Traveler's Chest and its items.
Installation
- Install Fabric Loader and Fabric API on a server running a supported Minecraft version.
- Download the latest version of Traveler's Chest from the releases page. One jar covers every supported Minecraft version.
- Place the
.jar file in your server's mods folder.
- Start your server to generate configuration files.
Configuration
Config Files
-
config/travelers-chest/travelers_chest_config.txt
- Example Contents:
debug_logging=false
- Enables or disables debug logging for detailed troubleshooting.
-
config/travelers-chest/chests.json
- Stores every Traveler's Chest by dimension and position, with its items, its cooldown and its name. The mod manages this file, so don't edit it by hand.
- If it cannot be read, the mod saves nothing until it can, and says so, rather than writing over it. Its previous version is kept beside it as
chests.json.bak.
-
config/travelers-chest/travelers_chests.json
- Where releases before 2.0.0 saved their chests. 2.0.0 imports it once and leaves it as it was, so going back to an older release still finds your chests. An imported chest starts its cooldown the first time it is loaded and found not full.
Usage
- Place a chest, single or double, and put the items in it.
- Face it and run
/travelers_chest create, or run /chests and click Add the chest I'm facing.
- Players open it and take what they need, as from any chest.
- One cooldown after the first take, the chest refills: each saved stack goes back into its slot, and other slots are left alone. Until someone takes from it, no cooldown runs.
- The refill happens when someone next opens either half of the chest, or when its area loads, so no area is loaded just to check a chest.
Commands
Operators (permission level 4) use these while looking at a chest, up to 20 blocks away:
/chests: opens the chest menus. Facing a Traveler's Chest, it opens that chest's menu; anywhere else, the list of every Traveler's Chest.
/travelers_chest create [time]: makes it a Traveler's Chest that refills with the items in it now, with a cooldown in seconds (default: 1800, half an hour).
/travelers_chest edit <time>: changes its cooldown. If the chest holds anything, what is in it now becomes what it refills with.
/travelers_chest destroy: turns it back into a plain chest. Its items stay in it.
Chest Functionality
- Refill Mechanism: A chest refills one cooldown after a player first takes from it, not on a fixed cycle. A slot is refilled when it holds anything other than its saved stack, enchantments and damage included.
- Shared Contents: Everyone takes from the same chest, as from any chest.
- Players Only: Hoppers, hopper minecarts, droppers and copper golems cannot pull from or push into a Traveler's Chest, so a comparator beside one reads 0.
- Double Chest Support: Opening either half of a double chest refills it.
- Protected Chests: Only operators can break a Traveler's Chest, either half of a double chest included. Explosions leave a Traveler's Chest and its items standing, while the blocks around it break as usual: TNT, creepers, end crystals, beds, respawn anchors, fireballs and wither skulls. A wither and the ender dragon pass it without breaking it, and a chest placed against a single one stays single, so the Traveler's Chest keeps its own slots. A trapped chest can be a Traveler's Chest too, and is protected the same way. A copper chest, from Minecraft 1.21.9, can be one too: it keeps its items, its name and its refills as it oxidizes, and copper golems take nothing from it.
/chests opens menus built from the game's own chest screens, so they work on every supported version:
- Facing a Traveler's Chest, it opens that chest's menu: a clock for the cooldown (left-click 10 minutes longer, right-click 10 minutes shorter, a minute at a time at 10 minutes and under, down to 1 minute; shift-click an hour), Open the chest, Refill now, Teleport there, Rename, and Turn into a plain chest.
- Anywhere else, it lists every Traveler's Chest on the server. Hover one to see its first items, where it is, its cooldown, and whether it is full or when it refills; click it to open its menu. The lime dye, Add the chest I'm facing, opens an anvil to name the chest you face, and the new Traveler's Chest starts with a 30-minute cooldown.
- Open the chest opens the chest itself from anywhere, refilled first. Move items in and out as at the chest. Back, in the row under a single chest, or Esc returns to the chest's menu; a double chest fills the screen, so its title says Esc to go back. Going back after a change asks whether to save the items: Save the items makes the chest refill with them from now on, and closing the question keeps the old items.
- Rename opens an anvil holding the current name. The name is written onto the chest, both halves of a double chest, so players see it as the chest's title. An emptied box keeps the current name.
- A chest whose block is gone shows as gone in the list, with Remove from the list.
Each button checks the operator level again before it acts, so only operators can change anything.



Debug Logging
Enable debug logging in config/travelers-chest/travelers_chest_config.txt for detailed logs of mod operations, such as chest refills and new Traveler's Chests:
debug_logging=true
Logs are output to the server console. Releases before 2.0.0 looked for this file in a folder that never exists, so they could not turn debug logging on.
JSON Structure
Chests are stored in chests.json (format 2) with the following schema, one entry per chest:
- dimension: The dimension the chest is in
- pos: Its position, as x, y and z
- double: Whether it is a double chest
- name: The name given in the menus, when it has one
- wait: The cooldown in seconds
- takenAt: The world time, in ticks, of the first take; present only while its cooldown runs
- items: The saved stacks, each with its slot, its dataVersion (the Minecraft data version it was saved at) and its item as SNBT text
Each stack is brought up to date by Minecraft's own item upgrades when it is read, so a world that moves to a newer Minecraft keeps its chests. Two flags can appear on a chest: unchecked, on an imported chest not yet loaded, and gone, when its block is missing.
Example:
{
"format": 2,
"chests": [
{
"dimension": "minecraft:overworld",
"pos": [-4, -60, -12],
"double": true,
"name": "Supply Cache",
"wait": 1800,
"takenAt": 291,
"items": [
{"slot": 0, "dataVersion": 3955, "item": "{id:\"minecraft:torch\",count:8}"},
{"slot": 30, "dataVersion": 3955, "item": "{id:\"minecraft:bread\",count:16}"}
]
}
]
}
travelers_chests.json, the 1.2.x file, is imported once and left as it was. If an older release runs in between and changes it, 2.0.0 imports it again.
Support
To support the development of Traveler's Chest, please join the GBTI Network for access to:
- Exclusive tools and resources
- Development support
Other Ways to Contribute
Links
License
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
评论 0
登录后参与评分
还没有评论,来抢沙发吧