尘曲
如下图:



范例:

  1. public class Mytest extends JavaPlugin implements Listener{
  2.    
  3.     String json;
  4.    
  5.     public void onEnable(){
  6.         getServer().getPluginManager().registerEvents(this, this);
  7.         this.json = "{"text": "【点击访问论坛页面】","bold":true,"color":"red","clickEvent":{"action":"open_url","value": "http://www.mcbbs.net"},"hoverEvent": {"action":"show_text","value": "MC中文论坛"}}";
  8.     }
  9.    
  10.     @EventHandler
  11.     public void onJoin(final PlayerJoinEvent e){
  12.         getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
  13.             public void run(){
  14.                 IChatBaseComponent comp = ChatSerializer.a(json);
  15.                 ((CraftPlayer)e.getPlayer()).getHandle().playerConnection.sendPacket(new PacketPlayOutChat(comp, true));
  16.             }
  17.         }, 10);
  18.     }
  19. }
复制代码




尘曲
单机的话官方提供了/tellraw指令

/tellraw 玩家 内容

就OK了

嘉晚饭,赢
额  多用能消息?  插件?

bali16
尘曲 发表于 2013-12-5 19:54
单机的话官方提供了/tellraw指令

/tellraw 玩家 内容

尘曲最近发什么神经= =

尘曲
wjwrh 发表于 2013-12-5 20:04
额  多用能消息?  插件?

嗯,插件,只适用1.7

嘉晚饭,赢
尘曲 发表于 2013-12-5 20:06
嗯,插件,只适用1.7

对会做插件会做mod的大触们各种膜拜..
刚刚研究到做插件的第一步就碰到障碍了...

zero28
不是说考试么还滚过来

下一页 最后一页