Files
netease-bedrock-wiki/mcguide/28-电脑网络游戏/课程3:编写Bukkit插件/3-进阶内容/9-Title与ActionBar的显示.md
2025-07-31 17:53:14 +08:00

16 lines
579 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
front:
hard: 进阶
time: 3分钟
---
# Title与ActionBar的显示
>
> *主观上在1.12.2后我们发送ActionBar和Title.*
> *Title只需要通过Player中的sendTitle方法.*
> *而ActionBar发送方式则是 Player 对象封装了内部对象 spigot(),其中里面则有静态方法 sendMessage 通过传入ChatMessageType枚举参数便可以发送ActionBar*
> *用Spigot的sendMessage得将内容转换成TextComponent*
但是Bukkit就没有能够直接发送ActionBar的发送方法.
所以我们就要通过NMS底层去自行封装一个方法.