NitWikit/docs/扩展阅读/格式化代码.md

47 lines
1.2 KiB
Markdown
Raw Normal View History

2024-05-25 02:05:55 +08:00
---
sidebar_position: 8
---
# 格式化代码
**格式化代码Formatting code**,又称**颜色代码Color code**,能使在游戏中加入含颜色和格式信息。
在Minecraft中可以以分节符号`§`)产生带色文字。 于Windows中按`Alt`+`NUMPAD0` `NUMPAD1` `NUMPAD6` `NUMPAD7`或`Alt`+`NUMPAD4` `NUMPAD1` `NUMPAD4` `NUMPAD5` `NUMPAD2`。 于macOS中按下`⌥ Option`+`6`。 于Linux中按下 `Compose`+`S`+`O`
![](_images/格式化代码/Minecraft_Formatting.gif)
:::note
通常在游戏客户端中,你不能打出 `§` 这个符号。
在配置文件中,你可以直接复制粘贴这个符号而不用自己输入。
:::
:::tip
为了方便,多数插件的配置中支持使用 `&` 来代表 `§`
比如下面这个 TrMenu菜单 例子
```
Icons:
test:
display:
material: stone
lore:
- '&11 &22 &33'
- '&aa &bb &cc'
```
![](_images/格式化代码/游戏内.png)
:::
如果你想要更绚丽的颜色和更丰富的功能(比如点击文本执行命令)
2024-05-25 02:19:35 +08:00
可以去看 [MiniMessage](MiniMessage.md) 部分
2024-05-25 02:05:55 +08:00
# 参考
- https://zh.minecraft.wiki/w/%E6%A0%BC%E5%BC%8F%E5%8C%96%E4%BB%A3%E7%A0%81