DisplayHud
DisplayHud 是一个用于 Minecraft 的屏幕空间渲染系统,它将显示实体转化为完全可控的 2D HUD 元素。
DisplayHud 不仅仅局限于传统的文本和图片叠加层,它允许开发者使用 Minecraft 原生的显示实体(包括 文本显示、物品显示和方块显示)来构建界面。
这使得 DisplayHud 不仅仅是一个简单的 HUD 插件。它可以用来创建从屏幕角落的小型状态指示器到 全屏界面、动画菜单,甚至 Minecraft 内部的完整 2D 游戏 等各种内容。
为什么选择 DisplayHud?
大多数 Minecraft HUD 系统最终都基于现有的 UI 元素,例如通过资源包渲染的血条、标题或字体。
这些方法对于传统的 HUD 非常有效,但当您想要创建更具动态性的内容时,它们就会变得受限。
DisplayHud 采取了不同的方法。
它使用 显示实体结合资源包核心着色器 在屏幕空间中渲染实体。结果是一个既保留了 Minecraft 显示实体系统的灵活性,又表现得像 2D 界面的 HUD 系统。
DisplayHud 会自动补偿 FOV(视场角)和屏幕纵横比 的差异,使 HUD 元素在不同的玩家设置下保持稳定的屏幕位置。
您可以使用它来构建仅占用屏幕一部分的小型 HUD——或者覆盖整个屏幕,从而有效地在 Minecraft 内部创建自己的 2D 界面层。
超越传统 HUD
由于 DisplayHud 使用的是实际的显示实体,而不是局限于传统的 HUD 渲染技术,因此它能够完成基于血条的系统难以或无法实现的功能。
| 功能 |
传统血条 HUD |
DisplayHud |
| 文本 |
✓ |
✓ |
| 图片 / 自定义纹理 |
✓ |
✓ |
| 3D 物品与方块模型 |
✗ |
✓ |
| 平滑插值移动 |
✗ |
✓ |
| 任意旋转 |
✗ |
✓ |
| 运行时变换 |
有限 |
✓ |
| 动态 HUD 修改 |
有限 |
✓ |
| 全屏 2D 界面 |
有限 |
✓ |
显示实体可以在游戏运行时进行 平移、缩放、旋转、动画制作和修改。
Minecraft 内置的显示插值功能还可用于实现平滑过渡和动画,而无需手动重建每一帧。
这开辟了以下可能性:
- 动画生命条和状态显示
- 自定义库存和菜单
- 直接嵌入 HUD 中的 3D 物品或模型
- 平滑移动的界面元素
- 旋转或变换的 HUD 组件
- 全屏游戏界面
- 过场动画叠加层
- 小游戏界面
- 完全在 Minecraft 内渲染的 2D 游戏
目标不仅仅是提供另一种绘制生命条的方法。
DisplayHud 为使用 Minecraft 的显示实体渲染系统构建屏幕空间界面提供了基础。
它是如何工作的?
DisplayHud 使用资源包的 核心着色器 来改变特定位置显示实体的渲染方式。
放置在特定 Y 阈值下方的显示实体被着色器检测并转换为屏幕空间元素。它们不会出现在 Minecraft 世界中的正常位置,而是相对于玩家的屏幕进行渲染。
因为只有在这个预留坐标范围内的显示实体才会被处理为 HUD 元素,所以 世界中其他地方使用的普通显示实体不受影响。
这意味着 DisplayHud 可以与普通的基于显示的模型、装饰、动画和其他系统共存,而不会将每个显示实体都视为 HUD 的一部分。
从玩家的角度来看,其表现就像传统的 2D 界面:无论玩家看向哪里,HUD 元素都固定在屏幕上。
但在幕后,它们保留了显示实体的所有能力。
专为动态界面设计
当 HUD 需要不断变化时,DisplayHud 尤其有用。
与其将 HUD 视为主要是静态的纹理,不如独立操作各个显示元素。
位置、缩放、旋转、显示内容、模型和其他属性都可以在运行时更改,允许开发者构建直接响应游戏玩法的界面。
结合插值功能,这使得创建具有 平滑运动和过渡 的界面成为可能,而不是让 HUD 元素在预定义位置之间简单跳转。
而且由于支持物品显示和方块显示,界面元素并不局限于平面图像。Minecraft 物品、方块和自定义资源包模型都可以成为界面本身的一部分。
你能构建什么?
DisplayHud 故意被设计为基础设施,而不是单一预定义的 HUD。
一个简单的项目可能只使用它来放置几个图标、文本标签或动画指示器。
更复杂的项目可以使用相同的系统来构建跨越玩家屏幕大部分或全部区域的界面。
在这种情况下,DisplayHud 可以有效地充当 Minecraft 内部的 2D 渲染层,使得通常需要使用更受限的 HUD 技术才能实现的项目成为可能。
如果 Minecraft 可以将其渲染为显示实体,DisplayHud 就为您提供了一种将其带入玩家界面的方法。
兼容性
Minecraft Java Edition:
1.21.8 – 1.21.11
DisplayHud 旨在配合其附带资源包用于服务器端项目。
普通的显示实体可以与 DisplayHud 一起使用,因为只有放置在 DisplayHud 预留渲染范围内的实体才会被解释为 HUD 元素。
文档
文档包含有关设置、配置、定位和创建 HUD 元素的信息。
英文文档目前正在更新中。
DisplayHud Wiki
源代码
DisplayHud 是开源的。
GitHub Repository
展示

DisplayHud
DisplayHud is a screen-space rendering system for Minecraft that turns Display Entities into fully controllable 2D HUD elements.
Rather than being limited to traditional text and image overlays, DisplayHud allows developers to build interfaces using Minecraft's native Display Entities — including Text Displays, Item Displays, and Block Displays.
This makes DisplayHud more than a simple HUD plugin. It can be used to create anything from a small status indicator in the corner of the screen to full-screen interfaces, animated menus, or even complete 2D games inside Minecraft.
Why DisplayHud?
Most Minecraft HUD systems are ultimately based on existing UI elements such as boss bars, titles, or fonts rendered through resource packs.
These approaches work well for conventional HUDs, but they become restrictive when you want to create something more dynamic.
DisplayHud takes a different approach.
It uses Display Entities combined with resource-pack core shaders to render entities in screen space. The result is a HUD system that retains the flexibility of Minecraft's Display Entity system while behaving like a 2D interface.
DisplayHud automatically compensates for differences in FOV and screen aspect ratio, allowing HUD elements to maintain stable screen positions across different player settings.
You can use this to build a small HUD occupying only part of the screen — or cover the entire screen and effectively create your own 2D interface layer inside Minecraft.
Beyond traditional HUDs
Because DisplayHud uses actual Display Entities rather than being limited to conventional HUD rendering techniques, it can do things that are difficult or impossible with bossbar-based systems.
| Feature |
Traditional Bossbar HUD |
DisplayHud |
| Text |
✓ |
✓ |
| Images / custom textures |
✓ |
✓ |
| 3D item & block models |
✗ |
✓ |
| Smooth interpolated movement |
✗ |
✓ |
| Arbitrary rotation |
✗ |
✓ |
| Runtime transformations |
Limited |
✓ |
| Dynamic HUD modification |
Limited |
✓ |
| Full-screen 2D interfaces |
Limited |
✓ |
Display entities can be translated, scaled, rotated, animated, and modified while the game is running.
Minecraft's built-in display interpolation can also be used for smooth transitions and animations without having to manually recreate every frame.
This opens up possibilities such as:
- Animated health bars and status displays
- Custom inventories and menus
- 3D items or models embedded directly into the HUD
- Smoothly moving interface elements
- Rotating or transforming HUD components
- Full-screen game interfaces
- Cutscene overlays
- Minigame interfaces
- 2D games rendered entirely inside Minecraft
The goal is not simply to provide another way to draw a health bar.
DisplayHud provides a foundation for building screen-space interfaces using Minecraft's Display Entity rendering system.
How does it work?
DisplayHud uses a resource pack's core shaders to change how specially positioned Display Entities are rendered.
Displays placed below a specific Y threshold are detected by the shader and transformed into screen-space elements. Instead of appearing at their normal position in the Minecraft world, they are rendered relative to the player's screen.
Because only displays within this reserved coordinate range are processed as HUD elements, normal Display Entities used elsewhere in the world are unaffected.
This means DisplayHud can coexist with ordinary display-based models, decorations, animations, and other systems without treating every Display Entity as part of the HUD.
From the player's perspective, the result behaves like a conventional 2D interface: HUD elements remain anchored to the screen regardless of where the player looks.
Behind the scenes, however, they retain the capabilities of Display Entities.
Designed for dynamic interfaces
DisplayHud is particularly useful when a HUD needs to change continuously.
Instead of treating the HUD as a mostly static texture, individual display elements can be manipulated independently.
Position, scale, rotation, displayed content, models, and other properties can be changed at runtime, allowing developers to build interfaces that respond directly to gameplay.
Combined with interpolation, this makes it possible to create interfaces with smooth motion and transitions rather than HUD elements that simply jump between predefined positions.
And because Item and Block Displays are supported, interface elements are not restricted to flat images. Minecraft items, blocks, and custom resource-pack models can become part of the interface itself.
What can you build?
DisplayHud is intentionally designed as a foundation rather than a single predefined HUD.
A simple project might use it for a few icons, text labels, or animated indicators.
More complex projects can use the same system to construct an interface spanning most or all of the player's screen.
At that point, DisplayHud can effectively act as a 2D rendering layer inside Minecraft, making projects possible that would normally require much more restrictive HUD techniques.
If Minecraft can render it as a Display Entity, DisplayHud gives you a way to bring it into the player's interface.
Compatibility
Minecraft Java Edition:
1.21.8 – 1.21.11
DisplayHud is intended for server-side projects using its accompanying resource pack.
Normal Display Entities remain usable alongside DisplayHud, as only entities placed within DisplayHud's reserved rendering range are interpreted as HUD elements.
Documentation
The documentation contains information about setup, configuration, positioning, and creating HUD elements.
English documentation is currently being updated.
DisplayHud Wiki
Source Code
DisplayHud is open source.
GitHub Repository
Showcase

评论 0
登录后参与评分
还没有评论,来抢沙发吧