如下图:
范例:
复制代码
范例:
- public class Mytest extends JavaPlugin implements Listener{
-
- String json;
-
- public void onEnable(){
- getServer().getPluginManager().registerEvents(this, this);
- this.json = "{"text": "【点击访问论坛页面】","bold":true,"color":"red","clickEvent":{"action":"open_url","value": "http://www.mcbbs.net"},"hoverEvent": {"action":"show_text","value": "MC中文论坛"}}";
- }
-
- @EventHandler
- public void onJoin(final PlayerJoinEvent e){
- getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
- public void run(){
- IChatBaseComponent comp = ChatSerializer.a(json);
- ((CraftPlayer)e.getPlayer()).getHandle().playerConnection.sendPacket(new PacketPlayOutChat(comp, true));
- }
- }, 10);
- }
- }
单机的话官方提供了/tellraw指令
/tellraw 玩家 内容
就OK了
/tellraw 玩家 内容
就OK了
额 多用能消息? 插件?
不是说考试么还滚过来
