public static void sendMessageToBungee(String message, SerializedData data) { ByteArrayOutputStream b = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(b); try { out.writeUTF("b"); // "b" means BungeeCord Message, will get // intercepted by the DefyTime Bungeecord Plugin byte[] serializedData = data.serialize(); out.writeUTF(message); out.write(serializedData); } catch (IOException e) { e.printStackTrace(); } Bukkit.getServer().sendPluginMessage(DefyTime.getInstance(), "BungeeCord", b.toByteArray()); }