HexText 通过支持完整 RGB 十六进制代码、嵌套颜色跨度以及少量动画文本效果,为 Minecraft 的字体渲染器扩展了现代化的色彩管线。本文档总结了可用的格式化标记及其交互方式,以便你充分利用该系统。
? 安装
此模组需要 UniMixins 才能运行。它可同时安装在服务器端和客户端。
标准 Minecraft 格式化
原版 § 风格的格式化代码在 HexText 中依然完全按其在基础 Minecraft 中的方式工作。
使用 HexText 时,你可能更倾向于使用 &(与号)来编写它们以便于输入;如果服务器允许
使用 & 进行格式化,HexText 会在渲染时将它们标准化为游戏原生格式。支持的代码如下:
| Token |
Description |
&0–&9, &a–&f |
原版调色板颜色(共 16 种)。 |
&k |
乱码/随机字符。 |
&l |
粗体文本。 |
&m |
删除线。 |
&n |
下划线。 |
&o |
斜体文本。 |
&r |
重置颜色并清除样式/效果。 |
如果你更喜欢原始语法,仍然可以使用 § 而不是 & 来输入相同的代码。
直接 RGB 颜色
HexText 识别两种以 RGB 为主的语法,让你超越原版调色板的限制:
内联十六进制颜色
使用 &#RRGGBB(或 §#RRGGBB)立即切换到精确的 RGB 颜色(例如
&#ff8800)。更改从代码后紧跟的字符处生效,并清除之前激活的任何
嵌套颜色跨度。
作用域十六进制跨度
用 <RRGGBB> ... </RRGGBB> 包裹一段文本,以应用颜色直到匹配的开标签。
这些跨度可以嵌套,并与内联十六进制代码协同工作。关闭一个跨度会恢复之前的
颜色,使得在不永久覆盖栈的情况下临时高亮显示文本变得容易。
如果服务器希望将格式化限制在内联代码中,可以禁用这些 HTML 风格的标签。
两种语法均接受大写或小写的十六进制数字。
特殊效果
除了原版的样式切换外,HexText 还增加了四种额外的效果代码。与其他格式化代码一样,它们可以使用 & 或 § 编写:
| Token |
Effect |
&g |
启用动画彩虹着色器。使用 &r 清除它。 |
&h |
将文本倒置(Dinnerbone 效果)。 |
&i |
为文本添加燃烧的叠加层。 |
&j |
应用轻微的抖动/震动动画。 |
效果将持续有效,直到渲染器重置它们。任何显式的重置(&r)或颜色栈
更改(如应用新颜色或关闭 <RRGGBB> 跨度)都会清除该效果,因此请将该代码放在你想要其产生动画效果的
颜色之后。
作者提示
- 十六进制颜色代码始终由六个十六进制数字组成——不支持简写形式(如
#abc)。
- 嵌套
<RRGGBB> 跨度是安全的;渲染器会维护内部颜色栈,并在跨度关闭时恢复之前的
颜色。
- 你可以在单个字符串中自由组合 RGB 颜色、原版颜色代码以及样式/效果切换。HexText 将在渲染前解析预期的输出结果。
通过这些标记,你可以表达复杂的渐变、高亮文本的特定部分,或使聊天消息产生动画效果,同时保持与 Minecraft 现有格式化系统的兼容性。
服务器配置
HexText 通过其配置文件中的 server 类别暴露了几个服务器端开关:
enableRgbHtmlFormat – 当为 true 时,解析上述描述的 <RRGGBB> 和 </RRGGBB> 标签。
将其设置为 false 可将其视为纯文本。
allowSignEditing – 控制玩家是否可以使用空手右键告示牌来打开编辑器。
universalAmpersandFormatting – 接受 &(与号)作为格式化代码和直接 RGB 颜色的替代符号,取代节号(section sign)。
ampersandsInChat – 在发送聊天消息或命令时,将与号格式化令牌转换为节号。
ampersandsInSigns – 在编辑告示牌时,将与号格式化令牌转换为节号。
ampersandsInRepairs – 在铁砧中重命名物品时,将与号格式化令牌转换为节号。
这些选项使得轻松调整 HexText 的行为以适应服务器的管理或游戏玩法需求变得非常简单。
HexText extends Minecraft's font renderer with a modern colour pipeline that understands full RGB
hex codes, nested colour spans, and a handful of animated text effects. This document summarises the
available formatting tokens and how they interact so you can take full advantage of the system.
? Installation
This mod requires UniMixins to run. It can be installed on both the Server and Client.
Standard Minecraft formatting
All of the vanilla § style formatting codes continue to work exactly as they do in base Minecraft.
When using HexText you may prefer to write them with an ampersand for easier typing; if the server
permits ampersand formatting HexText will normalise them for the game at render time. The supported
codes are:
| Token |
Description |
&0–&9, &a–&f |
Vanilla palette colours (16 in total). |
&k |
Obfuscated/random glyphs. |
&l |
Bold text. |
&m |
Strikethrough. |
&n |
Underline. |
&o |
Italic text. |
&r |
Reset colour and clear styles/effects. |
You can still type the same codes with § instead of & if you prefer the original syntax.
Direct RGB colours
HexText recognises two RGB-focused syntaxes that let you move beyond the vanilla palette:
Inline hex colours
Use &#RRGGBB (or §#RRGGBB) to immediately switch to an exact RGB colour (for example
&#ff8800). The change takes effect from the character immediately following the code and clears any
nested colour spans that were active before it.
Scoped hex spans
Wrap a section of text in <RRGGBB> ... </RRGGBB> to apply a colour until the matching closing tag.
These spans can be nested and work alongside inline hex codes. Closing a span restores the previous
colour, making it easy to temporarily highlight text without permanently overwriting the stack.
Servers can disable these HTML-style tags if they want to restrict formatting to inline codes.
Both syntaxes accept upper- or lower-case hexadecimal digits.
Special effects
In addition to vanilla style toggles, HexText adds four extra effect codes. Like other formatting
codes they can be written with either & or §:
| Token |
Effect |
&g |
Enables the animated rainbow shader. Use &r to clear it. |
&h |
Flips the text upside-down (Dinnerbone effect). |
&i |
Adds a fiery ignite overlay to the text. |
&j |
Applies a subtle shake/jitter animation. |
Effects remain active until the renderer resets them. Any explicit reset (&r) or colour-stack
change (such as applying a new colour or closing a <RRGGBB> span) clears the effect, so place the
code after the colour you want it to animate.
Tips for authors
- Hex colour codes are always six hexadecimal digits – shorthand (
#abc) is not supported.
- Nesting
<RRGGBB> spans is safe; the renderer keeps an internal colour stack and restores the
previous colour when a span closes.
- You can freely combine RGB colours, vanilla colour codes, and style/effect toggles in a single
string. HexText will resolve the intended output before rendering.
With these tokens you can express complex gradients, highlight sections of text, or animate chat
messages while remaining compatible with Minecraft's existing formatting system.
Server configuration
HexText exposes several server-side toggles via the server category of its configuration file:
enableRgbHtmlFormat – when true, the <RRGGBB> and </RRGGBB> tags described above are parsed.
Set this to false to treat them as literal text.
allowSignEditing – controls whether players can right-click signs with an empty hand to open the
editor.
universalAmpersandFormatting – accepts ampersands as an alternative to the section sign for
formatting codes and direct RGB colours.
ampersandsInChat – converts ampersand formatting tokens to section signs when sending chat
messages or commands.
ampersandsInSigns – converts ampersand formatting tokens to section signs while editing signs.
ampersandsInRepairs – converts ampersand formatting tokens to section signs when renaming items
in anvils.
These options make it easy to tailor HexText's behaviour to a server's moderation or gameplay needs.
评论 0
登录后参与评分
还没有评论,来抢沙发吧