Tiny DataLib:数据包的必备实用工具库
Tiny DataLib 是一个轻量级、高性能的库,专为处理数据包开发中的“繁重工作”而设计。无论你需要计算复杂距离、管理持久实体数据,还是执行精确射线检测,Tiny DataLib 都提供了一套简洁且基于宏的 API,让你专注于构建游戏机制,而非调试 NBT。
主要特性
| 特性 | 描述 | 重要性 |
|---|---|---|
| 混合数据库 | 使用 UUID(用于玩家/实体)或 自定义键(用于全局设置/配置)存储数据。 | 足够灵活,可用于玩家统计信息、自定义方块数据或全服变量。 |
| 存储内变量数学运算 | 通过宏直接在数据库变量上执行操作(+=、-=、*=、/= 等)。 |
不再需要手动在记分板与 NBT 之间转换。只需一次函数调用即可更新数据。 |
| 精细的数据控制 | 对特定 NBT 路径进行精确 get/set,或对完整对象进行 get_full/set_full。 |
优化性能:仅移动你实际需要的数据。 |
| 精确距离计算 | 计算世界中任意两个实体或点之间的确切距离。 | 非常适合范围检查、自定义 AI 或范围效果法术。 |
| 智能射线检测 | 高速方块检测,精准定位玩家视线所及之处。 | 对于自定义工具、魔法杖和交互式环境至关重要。 |
为现代开发者设计
Tiny DataLib 专为 Minecraft 1.21.11 构建,充分利用了最新的引擎特性:
- 宏优先设计: 使用
$(variable)输入,让你的函数调用具备极高的灵活性。 - 开发者友好: 清晰的返回值代码(例如
-1表示条目缺失,-2表示路径无效)帮助你即时调试。 - 优化的性能: 采用基于“Entry”的逻辑,最大限度地减少卡顿并保持高刻率。
快速上手
使用 Tiny DataLib 就像运行单个函数调用一样简单!
注意: 从 v0.0.2 版本开始,库已从“Save”术语迁移到 “Entry”,以提高技术准确性。
你可以在我们的 Wiki 中找到完整的 API 文档、函数参数和示例。
展望未来
我们正不断演进 Tiny DataLib。未来的更新将重点关注:
- 高级射线检测: 改进实体碰撞箱检测。
- 距离优化: 进一步降低高频计算的开销。
- Custom Give 2.0: 智能物品堆叠、溢出处理及 Component 支持。
- 新模块: 用于假人(盔甲架)动画和更简便的属性管理工具。
准备好加速你的开发了吗? [立即下载 Tiny DataLib v0.0.3 ALPHA]
本库依据 MIT 许可证 授权。请记住在你的 Modrinth 项目中将 Tiny DataLib 列为依赖项!
Tiny DataLib: The Essential Utility Toolkit for Minecraft Datapacks
Tiny DataLib is a lightweight, high-performance library designed to handle the "heavy lifting" of datapack development. Whether you need to calculate complex distances, manage persistent entity data, or run precise raycasts, Tiny DataLib provides a clean, macro-powered API so you can focus on building your game mechanics, not debugging NBT.
Key Features
| Feature | Description | Why it matters |
|---|---|---|
| Hybrid Database | Store data using UUIDs (for players/entities) or Custom Keys (for global settings/configs). | Flexible enough for player stats, custom block data, or world-wide variables. |
| In-Storage Var Math | Perform operations (+=, -=, *=, /=, etc.) directly on database variables via macros. |
No more manual scoreboard-to-NBT shuffling. Update data in a single function call. |
| Granular Data Control | Precision get/set for specific NBT paths or get_full/set_full for entire objects. |
Optimized performance: only move the data you actually need. |
| Accurate Distance | Calculate the exact distance between any two entities or points in the world. | Perfect for range checks, custom AI, or area-of-effect spells. |
| Intelligent Raycasting | High-speed block detection to find exactly what a player is looking at. | Essential for custom tools, magic wands, and interactive environments. |
Designed for Modern Developers
Tiny DataLib is built for Minecraft 1.21.11, leveraging the latest engine features:
- Macro-First Design: Use
$(variable)inputs for extreme flexibility in your function calls. - Developer Friendly: Clear return codes (e.g.,
-1for missing entries,-2for invalid paths) help you debug instantly. - Optimized Performance: Uses "Entry" based logic to minimize lag and keep your tick-rate high.
Getting Started
Using Tiny DataLib is as simple as running a single function call!
Note: As of v0.0.2, the library has migrated from "Save" terminology to "Entry" for better technical accuracy.
You can find the complete API documentation, function parameters, and examples in our Wiki.
Looking Ahead
We are continuously evolving Tiny DataLib. Future updates will focus on:
- Advanced Raycasting: Improved entity hitbox detection.
- Distance Optimization: Further reducing overhead for high-frequency calculations.
- Custom Give 2.0: Intelligent item stacking, overflow handling, and Component support.
- New Modules: Tools for Mannequin (Armor Stand) animation and easier Attribute management.
Ready to accelerate your development? [Download Tiny DataLib v0.0.3 ALPHA Today]
Licensed under the MIT License. Please remember to list Tiny DataLib as a dependency in your Modrinth project!
下载 Tiny DataLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Tiny DataLib
下载 Tiny DataLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Tiny DataLib
下载 Tiny DataLib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Tiny DataLib
Tiny DataLib v0.0.3 ALPHA
"Raycast Improved"
欢迎使用第三次 Alpha 版本!本次更新完全专注于 Raycast 模块——使其更加灵活、强大,并支持自定义范围,从而更易于使用。
版本亮点
- 改进的 Raycast: 新增自定义范围射线检测功能,允许你设置自己的检测范围;此外,你还可以将
notfound设置为当未找到方块时返回的值!
迁移指南(破坏性变更)
如果你是从 v0.0.1-2 升级的,你必须更新你的函数调用。
- 旧版:
tiny_datalib:raycast/block - 新版:
tiny_datalib:raycast/block {range:<范围>,notfound:<未找到时的行为>}
返回代码:
Any:成功。None/Fail:可能是范围或“未找到时的行为”设置错误(必须指定!)。<未找到时的行为>:未找到任何方块。
未来计划
- 射线检测: 提高了方块检测的精度。
- 距离: 优化了高频检查的计算。
- 自定义给予: 智能物品堆叠和“背包已满”检测。
- 新增模块: 高级人偶/盔甲架动画控制。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
数据包
此数据包添加了属于阿瓦里海盗的独特结构,将他们的独特风格带入你的 Minecraft 世界!兼容性:1.20 至 26.3
数据包
一个 Minecraft 光线投射库,能够精确检测玩家正在查看的方块,包括像台阶和楼梯这样的特殊方块形状。
数据包
此数据包添加了新的“祝福模式”难度。
数据包
允许服务器管理员方便地禁用 Xaero's Map 系列模组中的实体雷达、小地图等功能,使竞技游戏更加公平。
数据包
使用原版/生存友好的方法更改青蛙的变种类型。支持原版(寒冷、温带、温暖)以及可选的“More Frogs 2”变种:深红、末影、地狱、毒镖、紫珀、幽匿、灵魂、诡异和木头。
数据包
粉色方块中的千种可能!
评论 0
登录后参与评分
还没有评论,来抢沙发吧