NotCachaaaaaaaaaa

Untitled

Apr 5th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public static void sendTitle(Player player, String title, String subtitle, int fadeIn, int stay, int fadeOut) {
  2. CraftPlayer craftplayer = (CraftPlayer) player;
  3. PlayerConnection connection = craftplayer.getHandle().playerConnection;
  4. IChatBaseComponent titleJSON = ChatSerializer.a("{'text': '" + title + "'}");
  5. IChatBaseComponent subtitleJSON = ChatSerializer.a("{'text': '" + subtitle + "'}");
  6. PacketPlayOutTitle titlePacket = new PacketPlayOutTitle(EnumTitleAction.TITLE, titleJSON, fadeIn, stay, fadeOut);
  7. PacketPlayOutTitle subtitlePacket = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, subtitleJSON);
  8. connection.sendPacket(titlePacket);
  9. connection.sendPacket(subtitlePacket);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment