Hologram API
一个用于在客户端支持世界内文本渲染的简单 API。本模组旨在简化我个人模组的开发流程。如果它符合你的需求,欢迎将其用于你自己的项目中。
使用此 API 的其他模组列表:
| Modrinth | Curseforge |
|---|---|
| Holo Damage Indicator | Holo Damage Indicator |
| Holo Health Indicator | Holo Health Indicator |
| Holo Items | Holo Items |

面向开发者
配置
下载适合你游戏版本的模组文件。 将其添加至依赖项中:
modApi files("<your file path>")
请将 <your file path> 替换为你下载的模组文件的实际路径。
注意:路径中的反斜杠请使用双 \\ 而不是单 \ ,以避免格式错误。
示例:
modApi files("C:\\Users\\UserName\\Documents\\hologram_api-fabric-1.0.0 1.21.1.jar")
使用示例
Component component = Component.literal("Hello World!").withStyle(ChatFormatting.GREEN); // 创建一个 Minecraft 组件
Hologram hologram = HologramAPI.create(comp, 0,80,0).lifetime(40).shadow(true).scale(2).renderDistance(20); // 创建全息投影
hologram.onUpdate(h -> { // 设置动画(每秒更新 20 次)
h.y += 0.05f; // 示例动画:每 tick 上升一个方块的高度。
});
这将创建一个位于坐标 (0, 80, 0) 处、显示文本 "Hello World!" 的全息投影。该投影持续时间为 40 秒,缩放比例为 2。此外,只有当玩家处于半径 20 格范围内时才会进行渲染。
Hologram API
A simple API for supporting in-world text rendering on the client side. This mod was created to simplify the creation process of my mods. Feel free to use this mod for your projects if it suits your needs.
List of my mods using this API:
| Modrinth | Curseforge |
|---|---|
| Holo Damage Indicator | Holo Damage Indicator |
| Holo Health Indicator | Holo Health Indicator |
| Holo Items | Holo Items |

For developers
Setup
Download a version of the mod that is suitable for your version. Add this to dependencies
modApi files("<your file path>")
<your file path> should be replaced to where your downloaded mod is.
Note: use double \\
instead of \ in your path to avoid formatting.
Example:
modApi files("C:\\Users\\UserName\\Documents\\hologram_api-fabric-1.0.0 1.21.1.jar")
Example Usage
Component component = Component.literal("Hello World!").withStyle(ChatFormatting.GREEN); //create a minecraft component
Hologram hologram = HologramAPI.create(comp, 0,80,0).lifetime(40).shadow(true).scale(2).renderDistance(20); //creating the hologram
hologram.onUpdate(h -> { //setting the animation (updates 20 times a second)
h.y += 0.05f; //example animation to rise one block up every tick.
});
This creates a hologram with text "Hello World!" at coordinates 0, 80 ,0. It lasts for a total of 40 seconds and has a scale of 2. Additionally, it will only render when the player is within 20 blocks of radius.
下载 Hologram API
下载 Hologram API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Hologram API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Hologram API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Hologram API
下载 Hologram API
下载 Hologram API
下载 Hologram API
下载 Hologram API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Hologram API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
修复依赖问题
修复依赖问题
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧