插件手册:betonquest:通知提示

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
插件手册:betonquest:通知提示 [2019/07/19 10:03]
小小k酱 [NotifyIO选项]
插件手册:betonquest:通知提示 [2020/10/25 00:48] (当前版本)
小小k酱 [Example 1 - Custom Notifications]
行 2: 行 2:
  
 ===== 简介 ===== ===== 简介 =====
-A notification is any message that is sent to the player either by BetonQuest itself, one of its plugins, or through a custom notify event.+一个“通知”就是发送给玩家的一个消息,它可以通过BetonQuest、某个插件、或自定义“通知事件”发出。
  
-You can customize what is sent by editing ''messages.yml''. This contains a list of languages and all the notifications used by BetonQuest.+你可以在''messages.yml''中自定义一个信息,它记录了各种消息以及对应的各种多国语言。
  
-If you want to customize how a notification is sent to the player then you can edit ''custom.yml'' to define a NotifyIO to use to for the specific notification. For example you can send a pop up achievement when the journal is updated and a bossbar notification when breaking blocks in a block objective.+如果你想自定义发送某个通知消息的方式,你还可以通过编辑''custom.yml''去自定义一个NotifyIO。举个例子,你可以在玩家的日志有更新的时候弹出一个成就,亦或者是玩家在某个拆除方块的任务目标中弹出一个bossbar通知。
  
 ===== 什么是NotifyIO通知提示系统? ===== ===== 什么是NotifyIO通知提示系统? =====
-NotifyIO is some method of sending a notification out. BetonQuest provides some by default and third party plugins may register their own.+NotifyIO指的是一些发送通知的方法。BetonQuest默认提供了一些,另外第三方插件也会提供额外的方法。
  
-The following are provided by default:+以下是一些默认提供的方法:
  
-  * ''suppress''Does not send anything. Good at turning off some notifications. +  * ''suppress''不发送任何通知。在某些时候你可以用这个来取消某个通知。 
-  * ''chat''(Default) Sends the notification as a chat message +  * ''chat''(默认)在聊天框显示 
-  * ''advancement''Sends a notification via a popup advancement +  * ''advancement''在右上角弹出一个成就框显示通知 
-  * ''actionbar''Sends a notification via the actionbar +  * ''actionbar''在动作栏(玩家物品栏上方)显示 
-  * ''bossbar''Sends a notification via a bossbar +  * ''bossbar''弹出一个boss血条栏显示 
-  * ''title''Sends a notification via a title +  * ''title''弹出一个标题显示 
-  * ''subtitle''Sends a notification via a subtitle+  * ''subtitle''弹出一个副标题显示
  
 ===== 默认的NotifyIO通知方式 ===== ===== 默认的NotifyIO通知方式 =====
-If not set, the default NotifyIO is ''chat''. You can change the default to ''actionbar'' by setting the following in ''config.yml'':+若不指定通知方式,默认通过聊天框''chat''显示。如果你想更改默认的通知提示方式,比如改成''actionbar'',你可以照如下修改''config.yml''配置文件:
  
 <code yaml [enable_line_numbers="true"]> <code yaml [enable_line_numbers="true"]>
行 91: 行 91:
  
 ===== NotifyIO通知方式 ===== ===== NotifyIO通知方式 =====
-Each NotifyIO has its own set of configuration that can be used. None are required. The built in ones will be described in this section.+每一种NotifyIO都有各自的设置参数,通常这些参数都不是必填的,BetonQuest自带的NotifyIO的参数如下:
  
-==== 静默 ==== +==== 静默: Suppress ==== 
-Does not output anything. Can be used to stop notifications.+不显示任何通知。可用于阻止显示某个通知。
  
-==== 聊天框 ==== +==== 聊天框: Chat ==== 
-Writes the notification to the players chat.+在玩家的聊天框显示通知。
  
-^  Option  ^  Description  ^ +^  参数  ^  描述  ^ 
-| sound | Sound to play. If blank, no sound. Can be from [[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|here]] or the name of a sound including from a custom resource. |+| sound | 播放什么声音,如果为空则不播放任何声音。请参考[[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|这个列表]]选找你需要播放的声音,或填写自定义资源包中的声音名字。 |
  
-==== Advancement ==== +==== 成就框: Advancement ==== 
-Shows the notification using an achievement popup.+弹出一个成就框并显示通知。
  
-^  Option  ^  Description  ^ +^  参数  ^  描述  ^ 
-| sound | Sound to play. If blank, no sound. Can be from [[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|here]] or the name of a sound including from a custom resource. +| sound | 播放什么声音,如果为空则不播放任何声音。请参考[[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|这个列表]]选找你需要播放的声音,或填写自定义资源包中的声音名字。 
-| frame | What Achievement frame to use. Can be: ''challenge''''goal''''task''+| frame | 什么类型的边框。可以是''challenge''''goal''''task''
-| icon | What icon to show. Must be the vanilla name of an item. Example: minecraft:map |+| icon | 用什么方块作为标志。必须填写Minecraft原生方块ID,比如''minecraft:map'' |
  
-==== Actionbar ==== +==== 动作栏: Actionbar ==== 
-Shows the notification using the actionbar.+在动作栏(在快捷物品栏上方)显示通知。
  
-^  Option  ^  Description  ^ +^  选项  ^  描述  ^ 
-| sound | Sound to play. If blank, no sound. Can be from [[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|here]] or the name of a sound including from a custom resource. |+| sound | 播放什么声音,如果为空则不播放任何声音。请参考[[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|这个列表]]选找你需要播放的声音,或填写自定义资源包中的声音名字。 |
  
-==== Bossbar ==== +==== Boss血条: Bossbar ==== 
-Shows the notification using a bossbar.+在Boss血条显示通知。
  
 ^  Option  ^  Description  ^ ^  Option  ^  Description  ^
-| sound | Sound to play. If blank, no sound. Can be from [[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|here]] or the name of a sound including from a custom resource. +| sound | 播放什么声音,如果为空则不播放任何声音。请参考[[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|这个列表]]选找你需要播放的声音,或填写自定义资源包中的声音名字。 
-| barFlags | What flags to add to bossbar. One of the following from [[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/boss/BarFlag.html|here]]. +| barFlags | 添加额外Bossbar效果,效果列表请参见[[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/boss/BarFlag.html|这里]] 
-| barColor | What color to draw the bar. One of the following from [[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/boss/BarColor.html|here]] | +| barColor | 血条颜色。可选的颜色列表请参见[[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/boss/BarColor.html|这里]]。 
-| progress | What progress to show the bar. A floating point number between 0.0 (empty) and 1.0 (full) +| progress | 血条进度。小数,数值介于0.0(空)和1.0(满血)之间。 
-| style | What style bar to use. One of the following from [[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/boss/BarStyle.html|here]] | +| style | 血条款式。款式列表请参见[[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/boss/BarStyle.html|这里]]。 
-| stay | How many ticks to keep the bar on screenDefaults to 70 +| stay | 血条在屏幕上的持续时间。单位ticks,默认值是70ticks(约等于3.5秒)。 
-| countdown | If set, will step the progress of the bar by countdown steps. For example, if set to 10, then 10 times during the time it is on the screen the progress will drop by 1/10 |+| countdown | 倒计时。如果设置了,血条长度会根据此数值递减。例如,当数值设置为10时,血条会在持续时间之内每次递减1/10。 |
  
-==== 标题 ==== +==== 标题: Title ==== 
-Shows the notification using a title.+通过标题显示通知。
  
-^  Option  ^  Description  ^ +^  选项  ^  描述  ^ 
-| sound | Sound to play. If blank, no sound. Can be from [[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|here]] or the name of a sound including from a custom resource. +| sound | 播放什么声音,如果为空则不播放任何声音。请参考[[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|这个列表]]选找你需要播放的声音,或填写自定义资源包中的声音名字。 
-| fadeIn | Ticks to fade the title in. Default 10 | +| fadeIn | 淡入时长。单位ticks,默认值是10。 
-| stay | Ticks to keep title on screen. Default 70 | +| stay | 持续时长。单位Ticks,默认值是70。 
-| fadeOut | Ticks to fade the title out. Default 20 | +| fadeOut | 淡出时长。单位Ticks,默认值是20。 
-| subTitle | Optional subtitle to show. All _'s are replaced with spaces |+| subTitle | 副标题内容。如果不为空则额外再显示一个副标题,文字中的下划线''_''会被显示成空格。 |
  
-==== 副标题 ==== +==== 副标题: Subtitle ==== 
-Shows the notification using a subtitle.+在副标题显示通知。
  
-^  Option  ^  Description  ^ +^  选项  ^  描述  ^ 
-| sound | Sound to play. If blank, no sound. Can be from [[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|here]] or the name of a sound including from a custom resource. +| sound | 播放什么声音,如果为空则不播放任何声音。请参考[[https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html|这个列表]]选找你需要播放的声音,或填写自定义资源包中的声音名字。 
-| fadeIn | Ticks to fade the title in. Default 10 | +| fadeIn | 淡入时长。单位ticks,默认值是10。 
-| stay | Ticks to keep title on screen. Default 70 | +| stay | 持续时长。单位Ticks,默认值是70。 
-| fadeOut | Ticks to fade the title out. Default 20 |+| fadeOut | 淡出时长。单位Ticks,默认值是20。 |
  
  
 ===== 自定义通知 ===== ===== 自定义通知 =====
-Using the ''notify'' event a custom notification can be sentIt can make use of any category defined or can override by directly defining the NotifyIO configuration options. Please refer to the Events-List chapter for more details on this event. +通过''notify''事件,你还可以随时随地显示自定义通知。在''notify''事件中你可以引用custom.yml中预先定义的NotifyIO,或直接编写一个。请参考[[插件手册:betonquest:事件列表#显示通知notify|事件列表-显示通知]]章节查看具体编写格式。
 ===== 例子 ===== ===== 例子 =====
  
-==== Example 1 - Custom Notifications ==== +==== 例子 1 - 自定义通知 ==== 
-Assuming the following custom.yml file:+假设你的custom.yml文件如下:
 <code yaml [enable_line_numbers="true"]> <code yaml [enable_line_numbers="true"]>
 notifications: notifications:
-    # Test Categories+    # 测试通知类别
     test_suppress:     test_suppress:
         io: suppress         io: suppress
行 200: 行 199:
 </code> </code>
  
-And the following events run in order:+并且下列//事件//会按顺序执行:
 <code yaml [enable_line_numbers="true"]> <code yaml [enable_line_numbers="true"]>
-Test of Category+测试通知类别
 notify_cat_suppress: notify Test Notify category:test_suppress notify_cat_suppress: notify Test Notify category:test_suppress
 notify_cat_chat: notify Test Notify category:test_chat notify_cat_chat: notify Test Notify category:test_chat
行 211: 行 210:
 notify_cat_subtitle: notify Test Notify category:test_subtitle notify_cat_subtitle: notify Test Notify category:test_subtitle
  
-Test of Category some custom+测试通知类别 一些自定义参数
 notify_catcus_title_sub: notify Test Notify category:test_title subtitle:"My SubTitle" notify_catcus_title_sub: notify Test Notify category:test_title subtitle:"My SubTitle"
 notify_catcus_bossbar_red: notify Test Notify category:test_bossbar barColor:red sound:ENTITY_BAT_TAKEOFF style:segmented_10 progress:0.3 notify_catcus_bossbar_red: notify Test Notify category:test_bossbar barColor:red sound:ENTITY_BAT_TAKEOFF style:segmented_10 progress:0.3
  
-Test of totally custom, needs an io+测试完全自定义参数+一些NotifyIO
 notify_cus_bossbar_green: notify Test Notify io:bossbar barColor:green stay:120 notify_cus_bossbar_green: notify Test Notify io:bossbar barColor:green stay:120
 notify_cus_advancement: notify Test Notify io:advancement icon:hopper frame:goal notify_cus_advancement: notify Test Notify io:advancement icon:hopper frame:goal
 </code> </code>
  
-A video can be found [[https://www.youtube.com/watch?v=mmEfIXp4dxA|here]]+运行效果请参考[[https://www.youtube.com/watch?v=mmEfIXp4dxA|这个视频]]
  
-==== Example 2 - Bossbar Countdown ==== +==== 例子 2 - Boss血条倒计时 ==== 
-Assuming the following events run in order:+假设有下列//事件//按顺序执行:
 <code yaml [enable_line_numbers="true"]> <code yaml [enable_line_numbers="true"]>
 notify_cus_bossbar_countdown1: notify Countdown Test Bossbar io:bossbar stay:120 countdown:10 progress:1 notify_cus_bossbar_countdown1: notify Countdown Test Bossbar io:bossbar stay:120 countdown:10 progress:1
行 229: 行 228:
 </code> </code>
  
-A video can be found [[https://i.imgur.com/x6Ihe7W.mp4|here]]+执行效果请参考[[https://i.imgur.com/x6Ihe7W.mp4|这个视频]]
  
-==== Example 3 - Using suppress on a builtin notification ==== +==== 例子 3 - 对内置的默认通知使用静默 ==== 
-If you don't want to see the ''changelog'' notifications then you can use the suppress notifyio for the category ''changelog''.+如果你不想对玩家显示''changelog''插件更新相关的通知,你可以使用“静默”''suppress''NotifyIO来强行关掉插件更新日志提示。
  
-Example custom.yml+custom.yml例子:
 <code yaml [enable_line_numbers="true"]> <code yaml [enable_line_numbers="true"]>
 notifications: notifications:
  • 插件手册/betonquest/通知提示.1563501839.txt.gz
  • 最后更改: 2019/07/19 10:03
  • 小小k酱