ServerboundRecipeBookSeenRecipePacket 0x30

ServerboundRecipeBookSeenRecipePacket: Minecraft 26.3 packet (0x30 Play serverbound). Wire name 'recipe_book_seen_recipe', fields: recipe, handled

Minecraft 26.3PlayServerboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x3048PLAYServerboundGamePacketTypes.SERVERBOUND_RECIPE_BOOK_SEEN_RECIPE: "recipe_book_seen_recipe"

Packet ids are positional: the id is the index of the addPacket call in the protocol builder (see ProtocolInfoBuilder.listPackets). Ids change between game versions.

Wire fields (1)

FieldType
recipeRecipeDisplayId

Fields are the components of the packet record.

Stream codec

static final StreamCodec<FriendlyByteBuf, ServerboundRecipeBookSeenRecipePacket> STREAM_CODEC = StreamCodec.composite( RecipeDisplayId.STREAM_CODEC, ServerboundRecipeBookSeenRecipePacket::recipe, Serv

Modern packets serialize through StreamCodecs instead of read/write methods.

Handling

Resolved on the ServerGamePacketListener packet-listener interface by void handleRecipeBookSeenRecipePacket(ServerboundRecipeBookSeenRecipePacket serverboundrecipebookseenrecipepacket). The implementation in the game is ServerGamePacketListenerImpl.

Full Source

ServerboundRecipeBookSeenRecipePacket.java23 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.game;
2
3
import net.minecraft.network.FriendlyByteBuf;
4
import net.minecraft.network.codec.StreamCodec;
5
import net.minecraft.network.protocol.Packet;
6
import net.minecraft.network.protocol.PacketType;
7
import net.minecraft.world.item.crafting.display.RecipeDisplayId;
8
9
public record ServerboundRecipeBookSeenRecipePacket(RecipeDisplayId recipe) implements Packet<ServerGamePacketListener> {
10
	public static final StreamCodec<FriendlyByteBuf, ServerboundRecipeBookSeenRecipePacket> STREAM_CODEC = StreamCodec.composite(
11
		RecipeDisplayId.STREAM_CODEC, ServerboundRecipeBookSeenRecipePacket::recipe, ServerboundRecipeBookSeenRecipePacket::new
12
	);
13
14
	@Override
15
	public PacketType<ServerboundRecipeBookSeenRecipePacket> type() {
16
		return GamePacketTypes.SERVERBOUND_RECIPE_BOOK_SEEN_RECIPE;
17
	}
18
19
	public void handle(final ServerGamePacketListener listener) {
20
		listener.handleRecipeBookSeenRecipePacket(this);
21
	}
22
}
23