Traveler's Lectern
属于 Traveler 系列。Traveler's Lectern 会生成一个讲台,玩家拿走书后,书本会在冷却结束后自动回到讲台上。将服务器规则、任务或旅行笔记放在上面供所有人阅读:玩家可以阅读书本或复制一份,讲台在冷却结束后会自动补满。
功能
- 玩家拿走书本后,经过一次冷却时间,书本会自动回到讲台上
- 任何人都可以阅读书本,并通过手持空物品栏潜行或使用讲台的“Take Book”按钮来拿走它
- 只有操作员(OP)才能破坏 Traveler's Lectern
- 爆炸、凋灵、末影龙和火焰不会摧毁 Traveler's Lectern
- Minecraft 1.21.6 及更高版本的游戏内讲台管理器:
/lecterns
- 仅服务端运行:玩家无需安装客户端模组
一个 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 Lectern 及其包含的书本。
配置
该模组可以通过 config/travelers-lectern/ 目录中的文件进行配置:
基本设置 (travelers_lectern_config.txt)
debug_logging=false
debug_logging: 启用或禁用调试日志,以便在服务器日志中获取详细信息。
讲台数据
- 讲台保存在配置文件文件夹中的
lecterns.json 文件中,按维度(dimension)和位置(position)分类保存。该模组管理此文件,请勿手动编辑。
- 2.0.0 之前的版本将其保存在
travelers_lecterns.json 中。2.0.0 版本会导入该文件一次并保留原样,因此回退到旧版本时仍能找到你的讲台。
- 如果无法读取
lecterns.json,模组在能够读取之前不会保存任何内容,而不是覆盖原有数据。其上一版本的备份会保存在旁边,文件名为 lecterns.json.bak。
命令
操作员(权限等级 4)在注视带有书本的讲台且距离不超过 20 格时使用以下命令:
/lecterns: 在 1.21.6 及更高版本中,打开讲台管理器。
/travelers_lectern create [time]: 将其设置为 Traveler's Lectern,冷却时间为秒数(默认值:1800,即半小时)。
/travelers_lectern edit <time>: 更改其冷却时间。
/travelers_lectern destroy: 将其恢复为普通讲台。如果书本不在讲台上,书本会先放回讲台。
使用方法
- 放置一个讲台并在上面放一本书。
- 面对讲台并运行
/lecterns 或 /travelers_lectern create。
- 玩家可以像往常一样阅读书本,并通过手持空物品栏潜行或使用“Take Book”按钮来拿走它。
- 书本在被拿走后的一个冷却周期后返回。在此之前,空的讲台不接受其他书本,并会告知玩家他们的书本何时返回。

在 1.21.6 及更高版本中,/lecterns 命令会打开一个基于 Minecraft 原生对话框屏幕构建的菜单:
- 面对一本放有书的 lectern(讲台)时,它提供将其设置为“旅行者 lectern”的选项,并显示重生时间(以分钟为单位)。
- 面对一个“旅行者 lectern”时,它会打开该 lectern 的编辑器:你可以更改重生时间、给自己复制一本、使用手中的书替换当前书籍、将已取走的书放回原位、传送至该位置,或将其恢复为普通 lectern。
- 在其他任何地方,它会列出服务器上所有的“旅行者 lectern”。悬停可查看其位置以及书籍是否已被取走。
服务器会对每次按钮点击进行验证,因此只有操作员(operators)才能更改任何设置。


? 开发
本模组使用以下工具构建:
- Java 17(对应 Minecraft 1.20.x)、Java 21(对应 1.21.x)和 Java 25(对应 26.x),通过 Stonecutter 从单一源码树编译
- Fabric API
- Gson 用于 JSON 解析与序列化
项目结构
src/main/java:包含主模组逻辑。
src/main/resources:包括资源文件、Mixin 配置和配置文件。
versions/:每个 jar 包对应一个文件夹,命名规则表明其针对的 Minecraft 版本。
关键文件
TravelersLectern.java:初始化模组并处理服务器事件。
Lecterns.java:处理取书、重生刻数,以及命令和管理器的功能逻辑。
LecternStore.java:读取和保存 lectern 数据,并导入旧版发布遗留的文件。
LecternBooks.java:在所有支持版本中将 lectern 的书作为文本读取或写入。
LecternBlockMixin.java:将对“旅行者 lectern”的点击事件交由模组处理;其他 lectern 保持原版行为。
dialog/:lectern 管理器(适用于 1.21.6 及更高版本)。
支持
加入 GBTI Network!
GBTI Network 是一个会员制社区:
- 独家开发工具和资源
- 私有代码仓库和代码库
- 用于协作的 Discord 社区
- 会员目录列表,展示你的作品
- 合作机会和项目伙伴关系
- 新功能和新工具的抢先体验
通过成为 GBTI Network 会员 来支持我们的工作。
其他支持方式:
许可证
本项目遵循 GNU 通用公共许可证 v3.0 授权
Traveler's Lectern
Part of the Traveler's Series. Traveler's Lectern makes a lectern whose book comes back after a player takes it. Leave server rules, quests or travel notes out for everyone: players read the book or take a copy, and the lectern refills itself after a cooldown.
Features
- The book comes back on the lectern one cooldown after a player takes it
- Anyone can read the book, and take it by sneaking with an empty hand or with the lectern's Take Book button
- Only operators can break a Traveler's Lectern
- Explosions, withers, the ender dragon and fire leave a Traveler's Lectern standing
- An in-game lectern manager on Minecraft 1.21.6 and later:
/lecterns
- 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 Lectern and its book.
Configuration
The mod can be configured through files in the config/travelers-lectern/ directory:
Basic Settings (travelers_lectern_config.txt)
debug_logging=false
debug_logging: Enable or disable debug logging for detailed information in server logs.
Lectern Data
- Lecterns are saved in
lecterns.json in the configuration folder, by dimension and position. The mod manages this file, so don't edit it by hand.
- Releases before 2.0.0 saved them in
travelers_lecterns.json. 2.0.0 imports that file once and leaves it as it was, so going back to an older release still finds your lecterns.
- If
lecterns.json cannot be read, the mod saves nothing until it can, rather than writing over it. Its previous version is kept beside it as lecterns.json.bak.
Commands
Operators (permission level 4) use these while looking at a lectern with a book on it, up to 20 blocks away:
/lecterns: on 1.21.6 and later, opens the lectern manager.
/travelers_lectern create [time]: makes it a Traveler's Lectern, with a cooldown in seconds (default: 1800, half an hour).
/travelers_lectern edit <time>: changes its cooldown.
/travelers_lectern destroy: turns it back into a plain lectern. If its book is out, the book goes back on first.
Usage
- Place a lectern and put a book on it.
- Face it and run
/lecterns, or /travelers_lectern create.
- Players read the book as usual, and take it by sneaking with an empty hand or with the Take Book button.
- The book comes back one cooldown after it was taken. Until then, the empty lectern takes no other book and tells players when theirs returns.

On 1.21.6 and later, /lecterns opens a menu built from Minecraft's own dialog screens:
- Facing a lectern that holds a book, it offers to make it a Traveler's Lectern, with the respawn time in minutes.
- Facing a Traveler's Lectern, it opens that lectern's editor: change the respawn time, give yourself a copy, use the book in your hand instead, put a taken book back now, teleport there, or turn it back into a plain lectern.
- Anywhere else, it lists every Traveler's Lectern on the server. Hover one to see where it is and whether its book is out.
The server checks every button press again, so only operators can change anything.


? Development
This mod was built using:
- Java 17 (Minecraft 1.20.x), Java 21 (1.21.x) and Java 25 (26.x), from one source tree with Stonecutter
- Fabric API
- Gson for JSON parsing and serialization
Project Structure
src/main/java: Contains the main mod logic.
src/main/resources: Includes assets, mixins, and configuration files.
versions/: One folder per jar, naming the Minecraft version it builds against.
Key Files
TravelersLectern.java: Initializes the mod and handles server events.
Lecterns.java: Taking the book, the respawn tick, and what the commands and the manager do.
LecternStore.java: Reads and saves lectern data, and imports the file older releases left.
LecternBooks.java: A lectern's book as text and back, on every supported version.
LecternBlockMixin.java: Hands clicks on a Traveler's Lectern to the mod; other lecterns stay vanilla.
dialog/: The lectern manager (1.21.6 and later).
Support
Join the GBTI Network!
The GBTI Network is a membership community:
- Exclusive development tools and resources
- Private repositories and code libraries
- Discord community for collaboration
- Member directory listing to showcase your work
- Co-op opportunities and project partnerships
- Early access to new features and tools
Support our work by becoming a GBTI Network member.
Other ways to Support:
Links
License
This project is licensed under the GNU General Public License v3.0
评论 0
登录后参与评分
还没有评论,来抢沙发吧