🚀 快速开始#
本页面简要介绍如何开始使用 Bookshelf 库及其使用方法。
📥 安装#
Bookshelf 管理器 是创建自定义 Bookshelf 捆绑包的官方工具。
✨ 主要优势
🎯 精准选择:仅选择所需模块
📊 依赖可视化:直观展示模块间关系的界面
🏷️ 标签系统:通过标签轻松识别并按用途分组模块
📥 安装步骤
选择所需模块
检查自动添加的依赖项
下载自定义捆绑包
Bookshelf releases are available on both GitHub and Modrinth. In each release, you will find zipped datapacks.
📥 安装选项
📚 捆绑包: 可下载包含特定类型所有模块和依赖项的完整捆绑包(单个数据包)。适合需要全面探索 Bookshelf 功能的用户。
🧩 按模块安装: 也可下载单个模块的数据包。每个模块压缩包包含其运行所需的所有依赖项。适合只需特定功能并希望保持安装轻量的用户。
下载后,将 zip 文件移至 Minecraft 世界的 datapacks 目录。
若使用 beet 构建流程,可通过 PyPI 安装 Bookshelf 包 (mcbookshelf) 以在构建中包含 Bookshelf 模块。
📥 Installation Steps
pip install mcbookshelf
安装完成后,可在 beet 配置中直接引用 Bookshelf 模块。
要包含完整捆绑包或特定模块:
require:
- bookshelf.bundle.dev
- bookshelf.bundle.<name_of_bundle>
- bookshelf.module.raycast
- bookshelf.module.<name_of_module>
开发者若需直接使用源代码,需先构建 Bookshelf。此构建过程是必要的,因为某些功能需要无法直接包含在源代码中的计算数据。开始步骤如下:
🛠️ 先决条件
基本了解数据包
UV installed
Git(用于克隆仓库)
📥 Installation Steps
克隆仓库:
git clone https://github.com/mcbookshelf/bookshelf.git
cd bookshelf
构建库:
uv run modules build
构建完成后,所有模块将作为数据包存放在 build 文件夹中。每个模块包含其依赖项及实用命名空间。
注意
Please note that while the datapacks from releases are stable, they might not include the very latest features or fixes that are available in the source code. If you want the most up-to-date version of Bookshelf, consider installing from source or downloading a pre-release from GitHub.
If you like the project, don’t hesitate to star it on GitHub and/or follow it on Modrinth 😉.
👶 初始步骤#
Once you’ve downloaded your Bookshelf datapack bundle (or multiple modules), install them in your Minecraft world. If you’re not familiar with installing datapacks, follow this tutorial.
Now that Bookshelf is installed, you can verify that everything is working by running:
function #bs.load:status
This command lists all loaded modules with their respective versions and checks for compatibility issues.
From there, you can explore the documentation for individual modules, try out examples, and start integrating their functionality into your own projects!
重要
Bookshelf 依赖常态实体提升性能。请勿清除所有实体,而应使用命令 kill @e[tag=!bs.persistent]。了解更多
📖 最佳实践#
Bookshelf is designed to minimize unintended side effects. However, complications can arise when multiple datapacks utilize the same one. To prevent potential issues, it’s always recommended to set inputs prior to executing a function. This holds true even though Bookshelf adheres to a strict policy of preserving inputs. By following this practice, you can prevent unexpected behaviors.
备注
本节内容正在完善中。若有改进 Bookshelf 初始步骤的建议,欢迎在 Discord 服务器 分享。
💬 这对您有帮助吗?
欢迎在下方留下您的问题和反馈!
