• 欢迎来到Minecraft插件百科!
  • 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
  • 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289

“ChatControl Pro/WIKI/JSON”的版本间的差异

来自Minecraft插件百科
跳转至: 导航搜索
(创建页面,内容为“ JSON 全称为 JavaScript Object Notation. 当你与服务器间进行了数据交换或存储数据到数据库内时, 数据只能为文本. JSON 广泛用于存…”)
 
 
(未显示同一用户的1个中间版本)
第1行: 第1行:
 
+
{{模板:ccpbox}}
 
 
 
JSON 全称为 JavaScript Object Notation. 当你与服务器间进行了数据交换或存储数据到数据库内时, 数据只能为文本. JSON 广泛用于存储不同的信息,比如玩家或服务器事件.它可以便于人们读取和修改并且便于机器分析和生成.
 
JSON 全称为 JavaScript Object Notation. 当你与服务器间进行了数据交换或存储数据到数据库内时, 数据只能为文本. JSON 广泛用于存储不同的信息,比如玩家或服务器事件.它可以便于人们读取和修改并且便于机器分析和生成.
  
Minecraft 在处理聊天时使用了 JSON. 为了增加聊天消息的功能, JSON 可以让其他玩家看到传输的数据. That way, you may view fancy chat components such as hover text or item specific information. ChatControl aims to fully support JSON and offers several way of using it.
+
Minecraft 在处理聊天时使用了 JSON. 为了增加聊天消息的功能, JSON 可以让其他玩家看到传输的数据. 因此你可以把鼠标放到文本或物品上来查看详细信息.<br>
 +
ChatControl 完全支持JSON.
  
== JSON in .yml Files ==
+
== .yml文件里的JSON ==
Files such as settings.yml or messages.yml support JSON just where a normal message would be. There are two ways of using it.
+
settings.yml messages.yml 有消息的地方就支持JSON. 有两种使用方式.
  
a) Prepending the message with <code>[JSON]</code> and then write JSON code directly.
+
a) 假设消息带有 <code>[JSON]</code>然后直接输入JSON代码.
 
  <code>Warn_Message: '[JSON] {"text": "Hello World"}'</code>
 
  <code>Warn_Message: '[JSON] {"text": "Hello World"}'</code>
b) Using multiple lines with the '|-' line delimiter, placing the <code>[JSON]</code> prefix on one line and the JSON code itself on the rest. An example:
+
b) '|-' 分隔成多行消息,在一行开头输入前缀 <code>[JSON]</code>并在下面输入JSON代码. :
 
  <code>Example_Message: |-
 
  <code>Example_Message: |-
 
  <nowiki> </nowiki> [JSON]
 
  <nowiki> </nowiki> [JSON]
 
  <nowiki> </nowiki> {"text": "Hover Me","hoverEvent": {"action": "show_text","value": {"text": "Hey there!"}}}</code>
 
  <nowiki> </nowiki> {"text": "Hover Me","hoverEvent": {"action": "show_text","value": {"text": "Hey there!"}}}</code>
  
== JSON in Rules ==
+
== 规则内的JSON ==
For server's limitations, it's not possible to send JSON like you would do elsewhere in packet rules. You can use the 'then console' operator and send a 'tellraw' command to the player:
+
由于服务器的限制, 你不能像发包规则中那样发送JSON.你可以使用 'then console' 运算符并对玩家发送 'tellraw'指令:
 
  <code>match ^This area is now protected.
 
  <code>match ^This area is now protected.
 
  dont verbose
 
  dont verbose
  then console tellraw {player} {"text": "This area is now protected."}</code>
+
  then console tellraw {player} {"text": "这片区域受到保护."}</code>
  
== JSON in Timed Messages in messages.yml ==
+
== 定时广播中的JSON ==
The message broadcaster is a special case for users willing to take advantage of the JSON elements. You need to set the prefix merely to [JSON], and place the actual text message in JSON formatting on the lines separately, including the prefix on every line manually.
+
定时广播也可以使用JSON.你只需加入前缀 [JSON],并以JSON格式输入消息即可.
  
An example:
+
一个例子:
 
  <code>Broadcaster:
 
  <code>Broadcaster:
 
   [..]
 
   [..]

2019年1月28日 (一) 23:46的最新版本

子页面

常见疑问

权限

指令

频道

JSON

分组

格式

Discord

获取帮助

变量

处理器

JavaScript变量

多世界聊天格式

自定义指令缩写

自定义服务器名

监听优先度

聊天忽略

本地化

JSON 全称为 JavaScript Object Notation. 当你与服务器间进行了数据交换或存储数据到数据库内时, 数据只能为文本. JSON 广泛用于存储不同的信息,比如玩家或服务器事件.它可以便于人们读取和修改并且便于机器分析和生成.

Minecraft 在处理聊天时使用了 JSON. 为了增加聊天消息的功能, JSON 可以让其他玩家看到传输的数据. 因此你可以把鼠标放到文本或物品上来查看详细信息.
ChatControl 完全支持JSON.

.yml文件里的JSON

如 settings.yml 或 messages.yml 有消息的地方就支持JSON. 有两种使用方式.

a) 假设消息带有 [JSON]然后直接输入JSON代码.

Warn_Message: '[JSON] {"text": "Hello World"}'

b) 用 '|-' 分隔成多行消息,在一行开头输入前缀 [JSON]并在下面输入JSON代码. 如:

Example_Message: |-
  [JSON]
  {"text": "Hover Me","hoverEvent": {"action": "show_text","value": {"text": "Hey there!"}}}

规则内的JSON

由于服务器的限制, 你不能像发包规则中那样发送JSON.你可以使用 'then console' 运算符并对玩家发送 'tellraw'指令:

match ^This area is now protected.
dont verbose
then console tellraw {player} {"text": "这片区域受到保护."}

定时广播中的JSON

定时广播也可以使用JSON.你只需加入前缀 [JSON],并以JSON格式输入消息即可.

一个例子:

Broadcaster:
  [..]
  Prefix: '[JSON]'
  Messages:
    global:
    - '{"text":"这是条测试消息!"}'