--- a/net/minecraft/network/protocol/common/custom/DiscardedPayload.java
+++ b/net/minecraft/network/protocol/common/custom/DiscardedPayload.java
@@ -4,13 +_,19 @@
 import net.minecraft.network.codec.StreamCodec;
 import net.minecraft.resources.ResourceLocation;
 
-public record DiscardedPayload(ResourceLocation id) implements CustomPacketPayload {
+public record DiscardedPayload(ResourceLocation id, byte[] data) implements CustomPacketPayload { // Paper - store data
     public static <T extends FriendlyByteBuf> StreamCodec<T, DiscardedPayload> codec(ResourceLocation id, int maxSize) {
-        return CustomPacketPayload.codec((value, output) -> {}, buffer -> {
+        return CustomPacketPayload.codec((value, output) -> {
+            // Paper start
+            // Always write data
+            output.writeBytes(value.data);
+        }, buffer -> {
             int i = buffer.readableBytes();
             if (i >= 0 && i <= maxSize) {
-                buffer.skipBytes(i);
-                return new DiscardedPayload(id);
+                final byte[] data = new byte[i];
+                buffer.readBytes(data);
+                return new DiscardedPayload(id, data);
+                // Paper end
             } else {
                 throw new IllegalArgumentException("Payload may not be larger than " + maxSize + " bytes");
             }
