--- a/net/minecraft/network/protocol/game/ServerboundSetCreativeModeSlotPacket.java
+++ b/net/minecraft/network/protocol/game/ServerboundSetCreativeModeSlotPacket.java
@@ -11,7 +_,7 @@
     public static final StreamCodec<RegistryFriendlyByteBuf, ServerboundSetCreativeModeSlotPacket> STREAM_CODEC = StreamCodec.composite(
         ByteBufCodecs.SHORT,
         ServerboundSetCreativeModeSlotPacket::slotNum,
-        ItemStack.validatedStreamCodec(ItemStack.OPTIONAL_UNTRUSTED_STREAM_CODEC),
+        ItemStack.validatedStreamCodec(ItemStack.OPTIONAL_UNTRUSTED_STREAM_CODEC).apply(ByteBufCodecs::trackDepth), // Paper - Track codec depth
         ServerboundSetCreativeModeSlotPacket::itemStack,
         ServerboundSetCreativeModeSlotPacket::new
     );
