FOLIA ✅ PAPER ✅ PURPUR ✅ 1.19.4 - 26.3 ✅
专为你的插件设计的基于数据包的全息投影,自 2.0.0 版本起也提供带有 /holo 命令和保存全息功能的独立插件。
功能特性
- 类型: 文本、方块和物品全息投影,排行榜(经典版、分页式、可切换、单屏显示),展示台,进度条,分页全息投影,悬停菜单,粒子文字和图片,物品标签
- 文本: MiniMessage 支持,无需资源包即可在文本中显示玩家头像(1.21.9+),ItemsAdder 表情符号,支持或不支持 PlaceholderAPI 的个性化玩家文本
- 动画: 打字效果、闪烁、移动渐变、闪光、乱序、彩虹色、揭示、循环。旋转、浮动、弹跳、脉冲、拉伸、摇摆、抖动、果冻效果、弹出/消失或自定义关键帧,客户端插值处理
- 特效: 路径动画、过渡效果(翻转、转向、挤压、弹出、滑动、翻动、掉落、旋转)、破碎效果
- 交互: 可点击的全息投影,包含可取消的
HologramInteractEvent事件,悬停菜单 - 可见性: 针对每个玩家的视图控制,查看权限,查看条件,查看距离,实体附着
- 独立插件:
/holo命令带 Tab 补全,全息投影保存在holograms.yml中,点击动作,支持从 DecentHolograms、FancyHolograms 和 HolographicDisplays 导入 - 基于数据包: 无真实实体存在,PlaceholderAPI 仅在查看者的文本发生变化时发送数据包
在测试服务器上运行 /holo demo 以查看周围所有类型的全息投影和动画效果。
免责声明
适用于 Paper、Purpur 和 Folia 1.19.4 - 26.3(Folia 从 1.20.1 开始支持)。不支持 Spigot。需要 PacketEvents 2.14.0 或更高版本。
全息投影是显示实体,这是 Java 版的功能。通过 Geyser 连接的 Bedrock 玩家无法在全息投影中看到玩家头像。
持久化全息投影是新功能。更新时请保留 holograms.yml 的备份。
安装设置
- 下载插件 .jar 文件
- 下载 PacketEvents 2.14.0 或更高版本
- 将两个 .jar 文件放入服务器的 plugins 文件夹并重启服务器
- 在游戏中使用
/holo创建全息投影,或将 HologramLib 作为依赖项添加到你的插件中
命令
权限 hologramlib.admin,别名 /holo 和 /hl。
| 命令 | 功能说明 |
|---|---|
/holo create <id> <text|item|block> [content] |
在你站立的位置创建一个已保存的全息投影 |
/holo content|scale|billboard|background|shadow|placeholders|permission <id> <value> |
编辑全息投影 |
/holo delete|info|tp|movehere <id> |
管理全息投影 |
/holo copy <id> <new id> |
复制全息投影 |
/holo list, /holo near [radius] |
列出所有全息投影或你附近的全息投影 |
/holo action <id> add <type:data>, /holo action <id> clear |
点击动作:message(消息)、command(命令)、console(控制台)、sound(声音)、teleport(传送)、connect(连接)、permission(权限),例如 command:spawn |
/holo import <decentholograms|fancyholograms|holographicdisplays> |
从其他插件导入全息投影 |
/holo demo [clear] |
生成展示所有功能的效果 |
/holo help |
列出所有命令 |
所有消息均可在 plugins/HologramLib/messages.yml 中修改。
项目集成设置
Gradle (Kotlin)
repositories {
maven("https://jitpack.io")
}
dependencies {
compileOnly("com.github.maximjsx:HologramLib:2.0.0")
}
Gradle (Groovy)
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compileOnly 'com.github.maximjsx:HologramLib:2.0.0'
}
Maven
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.maximjsx</groupId>
<artifactId>HologramLib</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
将此添加到你的 plugin.yml 中:
depend:
- HologramLib
不建议对 HologramLib 进行阴影打包(Shading)。请在服务器上直接安装它。
代码示例
获取实例
private HologramManager hologramManager;
@Override
public void onEnable() {
HologramLib.getManager().ifPresentOrElse(
manager -> hologramManager = manager,
() -> getLogger().severe("HologramLib is not loaded"));
}
创建全息投影
TextHologram hologram = new TextHologram("unique_id")
.setMiniMessageText("<aqua>Hello world!")
.setSeeThroughBlocks(false)
.setBillboard(Display.Billboard.VERTICAL)
.setShadow(true)
.setScale(1.5F, 1.5F, 1.5F)
.setTextOpacity((byte) 200)
.setBackgroundColor(Color.fromARGB(60, 255, 236, 222).asARGB())
.setAlignment(TextDisplay.TextAlignment.CENTER)
.setMaxLineWidth(200);
生成与移除
hologramManager.spawn(hologram, location);
hologramManager.remove(hologram);
使其移动和响应
hologram.setTextProvider(player -> "<gold>Hey " + player.getName());
hologramManager.applyMotion(hologram, MotionAnimation.floating(0.2F, 40));
hologramManager.applyAnimation(hologram, TextAnimation.typing("<aqua>", "Welcome to the server"));
hologram.onInteract(player -> player.sendMessage("You clicked me"));
自定义文本动画
TextAnimation animation = new TextAnimation()
.setDelay(20) // 第一帧之前的延迟(以刻为单位)
.setSpeed(20) // 每帧的间隔(以刻为单位)
.addFrame("<red>第一帧")
.addFrame("<green>第二帧")
.addFrame("第三帧<newline>第三帧的第二行")
.addFrame("最后一帧");
hologramManager.applyAnimation(hologram, animation);
排行榜
LeaderboardHologram leaderboard = new LeaderboardHologram(LeaderboardHologram.LeaderboardOptions.builder()
.title("Top Players - Kills")
.suffix("kills")
.maxDisplayEntries(10)
.showEmptyPlaces(true)
.leaderboardType(LeaderboardHologram.LeaderboardType.TOP_PLAYER_HEAD)
.build(), "top_kills");
leaderboard.setPlayerScore(uuid, "MaximDe", 1000);
leaderboard.setPlayerScore(otherUuid, "dream", 950);
hologramManager.spawn(leaderboard, location);
文本排行榜
一个完整的排行榜显示在一个文本组件中,包含对齐的分数、下方的切换按钮以及动态行效果。
TextLeaderboard board = new TextLeaderboard("kills")
.setTitle("<gold><bold>Top Kills")
.setEntries(List.of(new TextLeaderboard.Entry(uuid, "MaximDe", 120)))
.addToggle(TextLeaderboard.Toggle.of("period", "Daily", "Weekly", "Lifetime"))
.setTransition(Transition.FLIP)
.setCycle(200);
hologramManager.spawn(board, location);
Wiki
所有功能及代码示例
使用 AI 助手?请提供 llms.txt,这是整个 API 的精简参考文档。
Example/Showcase Plugin
更多信息
FOLIA ✅ PAPER ✅ PURPUR ✅ 1.19.4 - 26.3 ✅
Packet-based holograms for your own plugins, and since 2.0.0 also a plugin with /holo commands and saved holograms.
FEATURES
- Types: text, block and item holograms, leaderboards (classic, paged, switchable, single display), podium, progress bars, paged holograms, hover menus, particle text and images, item labels
- Text: MiniMessage, player heads in text without a resource pack (1.21.9+), ItemsAdder emojis, per-player text with or without PlaceholderAPI
- Animations: typing, blink, moving gradient, shine, scramble, rainbow, reveal, cycle. Spin, floating, bounce, pulse, stretch, swing, shake, jelly, pop in/out or your own keyframes, interpolated on the client
- Effects: path animations, transitions (flip, turn, squash, pop, slide, flap, drop, spin), shatter effect
- Interactions: clickable holograms with a cancellable
HologramInteractEvent, hover menus - Visibility: per-player viewers, view permission, view conditions, view distance, entity attachment
- Standalone plugin:
/holocommand with tab completion, holograms saved inholograms.yml, click actions, import from DecentHolograms, FancyHolograms and HolographicDisplays - Packet-based: no real entities, PlaceholderAPI only sends a packet when a viewer's text changed
Run /holo demo on a test server to see every hologram type and animation around you.
DISCLAIMER
Works on Paper, Purpur and Folia 1.19.4 - 26.3 (Folia from 1.20.1). Spigot is not supported.Requires PacketEvents 2.14.0 or newer.
Holograms are display entities, a Java Edition feature. Bedrock players through Geyser don't see player heads in holograms.
Persistent holograms are new. Keep a backup of holograms.yml when you update.
SETUP
- Download the plugin .jar
- Download PacketEvents 2.14.0 or newer
- Put both .jar files into your server's plugins folder and restart
- Create holograms in game with
/holo, or add HologramLib as a dependency to your plugin
COMMANDS
Permission hologramlib.admin, aliases /holo and /hl.
| Command | What it does |
|---|---|
/holo create <id> <text|item|block> [content] |
Creates a saved hologram where you stand |
/holo content|scale|billboard|background|shadow|placeholders|permission <id> <value> |
Edits a hologram |
/holo delete|info|tp|movehere <id> |
Manages a hologram |
/holo copy <id> <new id> |
Copies a hologram |
/holo list, /holo near [radius] |
Lists all holograms or the ones close to you |
/holo action <id> add <type:data>, /holo action <id> clear |
Click actions: message, command, console, sound, teleport, connect, permission, e.g. command:spawn |
/holo import <decentholograms|fancyholograms|holographicdisplays> |
Imports holograms from another plugin |
/holo demo [clear] |
Spawns a showcase of every feature |
/holo help |
Lists every command |
All messages can be changed in plugins/HologramLib/messages.yml.
PROJECT SETUP
Gradle (Kotlin)
repositories {
maven("https://jitpack.io")
}
dependencies {
compileOnly("com.github.maximjsx:HologramLib:2.0.0")
}
Gradle (Groovy)
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compileOnly 'com.github.maximjsx:HologramLib:2.0.0'
}
Maven
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.maximjsx</groupId>
<artifactId>HologramLib</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
Add this to your plugin.yml:
depend:
- HologramLib
Shading HologramLib is not recommended. Install it on the server instead.
Code examples
Getting the instance
private HologramManager hologramManager;
@Override
public void onEnable() {
HologramLib.getManager().ifPresentOrElse(
manager -> hologramManager = manager,
() -> getLogger().severe("HologramLib is not loaded"));
}
Creating a hologram
TextHologram hologram = new TextHologram("unique_id")
.setMiniMessageText("<aqua>Hello world!")
.setSeeThroughBlocks(false)
.setBillboard(Display.Billboard.VERTICAL)
.setShadow(true)
.setScale(1.5F, 1.5F, 1.5F)
.setTextOpacity((byte) 200)
.setBackgroundColor(Color.fromARGB(60, 255, 236, 222).asARGB())
.setAlignment(TextDisplay.TextAlignment.CENTER)
.setMaxLineWidth(200);
Spawning and removing
hologramManager.spawn(hologram, location);
hologramManager.remove(hologram);
Make it move and react
hologram.setTextProvider(player -> "<gold>Hey " + player.getName());
hologramManager.applyMotion(hologram, MotionAnimation.floating(0.2F, 40));
hologramManager.applyAnimation(hologram, TextAnimation.typing("<aqua>", "Welcome to the server"));
hologram.onInteract(player -> player.sendMessage("You clicked me"));
Your own text animation
TextAnimation animation = new TextAnimation()
.setDelay(20) // ticks before the first frame
.setSpeed(20) // ticks per frame
.addFrame("<red>First frame")
.addFrame("<green>Second frame")
.addFrame("Third frame<newline>Second line in third frame")
.addFrame("Last frame");
hologramManager.applyAnimation(hologram, animation);
Leaderboard
LeaderboardHologram leaderboard = new LeaderboardHologram(LeaderboardHologram.LeaderboardOptions.builder()
.title("Top Players - Kills")
.suffix("kills")
.maxDisplayEntries(10)
.showEmptyPlaces(true)
.leaderboardType(LeaderboardHologram.LeaderboardType.TOP_PLAYER_HEAD)
.build(), "top_kills");
leaderboard.setPlayerScore(uuid, "MaximDe", 1000);
leaderboard.setPlayerScore(otherUuid, "dream", 950);
hologramManager.spawn(leaderboard, location);
Text leaderboard
A whole leaderboard in one text display, with aligned scores, toggles under it and animated rows.
TextLeaderboard board = new TextLeaderboard("kills")
.setTitle("<gold><bold>Top Kills")
.setEntries(List.of(new TextLeaderboard.Entry(uuid, "MaximDe", 120)))
.addToggle(TextLeaderboard.Toggle.of("period", "Daily", "Weekly", "Lifetime"))
.setTransition(Transition.FLIP)
.setCycle(200);
hologramManager.spawn(board, location);
Wiki
Every feature with code examples
Using an AI assistant? Give it llms.txt, a compact reference of the whole API.
Example/Showcase Plugin
More info
下载 HologramLib | 排行榜与自定义全息
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HologramLib | 排行榜与自定义全息
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HologramLib | 排行榜与自定义全息
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HologramLib | 排行榜与自定义全息
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HologramLib | 排行榜与自定义全息
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HologramLib | 排行榜与自定义全息
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HologramLib | 排行榜与自定义全息
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HologramLib | 排行榜与自定义全息
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HologramLib | 排行榜与自定义全息
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HologramLib | 排行榜与自定义全息
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
持久化全息图回归
- HologramLib 现在可以独立运行:在游戏中创建全息图,它们会保存到
holograms.yml(非主线程操作,并带有备份),并在每次启动时重新生成 /hologramlib命令(别名/holo、/hl,权限hologramlib.admin),支持标签补全和可点击的编辑按钮- 点击动作:发送消息、执行命令、控制台指令、播放声音、传送、连接服务器和权限检查
- 通过
/holo import从 DecentHolograms、FancyHolograms 和 HolographicDisplays 导入数据 - 所有命令消息均可在
messages.yml中自定义 /holo demo会在你周围生成每种类型的全息图和动画
动画效果
- 文本预设:打字机效果、闪烁、移动渐变、闪光、乱码、彩虹色、揭示、循环
- 运动预设:旋转、漂浮、弹跳、脉冲、拉伸、摇摆、抖动、果冻效果、弹出/消失,或自定义关键帧。客户端插值计算,每个关键帧仅发送一个数据包而非每秒一个
- 路径动画、过渡效果(翻转、转向、挤压、弹出、滑动、扇动、掉落、旋转)以及碎裂特效
新型全息图类型
- TextLeaderboard:单个文本显示中包含整个排行榜,具有对齐的分数、切换选项和动态行
- SwitchableLeaderboard:通过按钮在不同统计数据之间切换,支持按玩家区分
- 领奖台、进度条、分页全息图、悬停菜单、物品标签、背景板
- 粒子文本和图像
API 接口
- 支持可点击的全息图,并提供可取消的
HologramInteractEvent事件 - 无需 PlaceholderAPI 即可实现基于玩家的文本显示(使用
setTextProvider) - 每个全息图支持独立的查看权限、查看条件和查看距离设置
- 文本中支持玩家头像
<head:name>,无需资源包(需 1.21.9+ 客户端) - PlaceholderAPI 仅在查看者的文本发生变化时才发送数据包
- 提供保存的全息图 API(
HologramLib.getPersistentHolograms())和PersistentHologramSpawnEvent事件 - 基于 1.8.5 版本构建的插件无需更改即可继续工作
修复内容
- 第 2 页及之后的排行榜排名重新从 1 开始计数
- 修复了数据变更后排行榜消失的问题
- SwitchableLeaderboard 的按钮现在支持按玩家区分
- PagedLeaderboard 现在正确遵循箭头设置
- 在 PagedLeaderboard 和 SwitchableLeaderboard 中实现了无闪烁的分页切换
- Folia 兼容性修复及减少数据包发送量
更新前须知
- 需要 PacketEvents 2.14.0 或更高版本
- 不支持 Spigot,请使用 Paper、Purpur 或 Folia(Folia 适用于 1.20.1 及以上版本)
- AddonLib 不再捆绑提供
- 持久化全息图为新功能,更新前请务必备份
holograms.yml
Modrinth 上跳过的版本
1.8.4 和 1.8.5 仅在 GitHub 发布,其变更已包含在本版本中。
开发者: compileOnly("com.github.maximjsx:HologramLib:2.0.0")
Wiki | 供 AI 助手使用的 llms.txt | 完整更新日志 | Discord
更新内容
- 提升依赖版本
- Bug 修复
Modrinth 上跳过的版本:
- 1.8.2 @RootException 在 #41 中改进了排行榜中的数字格式
- 1.8.1 依赖更新 更新了 FoliaLib 的版本 更新了 packetevents 的版本 更新了 EntityLib 的版本
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
自定义你的Minecraft头像!
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
评论 0
登录后参与评分
还没有评论,来抢沙发吧