Exemplo n.º 1
0
 public static void sendClickableMessage(
     Player p, String baseMsg, String hoverMsg, String action, String toDo) {
   IChatBaseComponent comp =
       ChatSerializer.a(
           "{\"text\":\""
               + baseMsg
               + "\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\""
               + hoverMsg
               + "\"},\"clickEvent\":{\"action\":\""
               + action
               + "\",\"value\":\""
               + toDo
               + "\"}}");
   PacketPlayOutChat pack = new PacketPlayOutChat(comp, true);
   ((CraftPlayer) p).getHandle().playerConnection.sendPacket(pack);
 }
Exemplo n.º 2
0
 public void send(Player player) {
   ((CraftPlayer) player)
       .getHandle()
       .playerConnection
       .sendPacket(new PacketPlayOutChat(ChatSerializer.a(toJSONString())));
 }