Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void sendTitle(Player p, String title, String subtitle) {
- /**
- * @auuthor CytoPlays
- * 1.8 Funktion
- * Titles
- */
- String title_text = title;
- String subtitle_text = subtitle;
- CraftPlayer cp = (CraftPlayer) p;
- PlayerConnection con = cp.getHandle().playerConnection;
- String title_json = ("{text:\"" + title_text + "\"}");
- String subtitle_json= ("{text:\"" + subtitle_text + "\"}");
- IChatBaseComponent comp_title = ChatSerializer.a(title_json);
- IChatBaseComponent comp_subtitle = ChatSerializer.a(subtitle_json);
- PacketPlayOutTitle packet_title = new PacketPlayOutTitle(EnumTitleAction.TITLE, comp_title);
- PacketPlayOutTitle packet_subtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, comp_subtitle);
- con.sendPacket(packet_title);
- con.sendPacket(packet_subtitle);
- }
Add Comment
Please, Sign In to add comment