Chat lore

Discussion in 'Plugin Development' started by Forseth11, Jan 20, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Forseth11

    How would I make something similar to the new minecraft achievements. I am trying to make a plugin where you hove over a word in chat and it has a box that pops up with words in it like with minecraft achievements.
     
  2. Offline

    Cirno

    There's no native API for this yet; you can use Fanciful. You can play around with to get it to work if you don't want dependencies:

    PacketPlayOutChat chatPacket = new PacketPlayOutChat(ChatSerializer.a("{\"text\": \"playername, prefix, etc."\",\"extra\": [{\"text\": \"" + args[0] + "\",\"color\": \"red\",\"hoverEvent\": {\"action\": \"show_text\",\"value\": \"" + ChatColor.RED + "This link may or may not contain NSFW content.\n" + ChatColor.RED + "It has not been verified by any staff members.\n" + ChatColor.RED + ChatColor.BOLD + "Please proceed with extreme caution.\"}}]}"), true);

    ((CraftPlayer)player).getHandle().playerConnection.sendPacket(chatPacket);

    The part with NSFW content is the lore. I tried to remove as much excess code that I made myself from it.
     
Thread Status:
Not open for further replies.

Share This Page