Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void sendTitle(Player player, String title, String subtitle, int fadeIn, int stay, int fadeOut) {
- CraftPlayer craftplayer = (CraftPlayer) player;
- PlayerConnection connection = craftplayer.getHandle().playerConnection;
- IChatBaseComponent titleJSON = ChatSerializer.a("{'text': '" + title + "'}");
- IChatBaseComponent subtitleJSON = ChatSerializer.a("{'text': '" + subtitle + "'}");
- PacketPlayOutTitle titlePacket = new PacketPlayOutTitle(EnumTitleAction.TITLE, titleJSON, fadeIn, stay, fadeOut);
- PacketPlayOutTitle subtitlePacket = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, subtitleJSON);
- connection.sendPacket(titlePacket);
- connection.sendPacket(subtitlePacket);
- }
Advertisement
Add Comment
Please, Sign In to add comment