0x11 C11PacketEnchantItem
Player selects an enchantment option in the enchanting table window. Carries window ID and button (0=top, 1=middle, 2=bottom).
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| windowId | byte | Enchantment table window ID |
| button | byte | Enchantment slot (0=top, 1=middle, 2=bottom) |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Window ID | byte | |
| Enchantment | byte | 0=top, 1=middle, 2=bottom |
MCP References
NetHandlerPlayServer.processEnchantItem()Handler Interface
INetHandlerPlayServerNotes
Vanilla Source
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
Deobfuscated MCP 1.8.9 source of C11PacketEnchantItem, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/client/C11PacketEnchantItem.java) at build time and verified present.
Deep Dive
Role in the protocol
C11 selects an enchantment option in an open enchanting table: a byte window id and a byte button (0 top, 1 middle, 2 bottom). It is the only serverbound packet whose sole effect is triggering Container.enchantItem, and it is sent from the vanilla GUI through PlayerControllerMP.enchantItem. The server replies with S2FPacketSetSlot carrying the enchanted result plus XP and lapis deltas.
Vanilla handling
processEnchantItem gates on three conditions: the packet's window id must equal the player's openContainer.windowId, the container must report canCraft, and the player must not be a spectator. Only then does it call enchantItem(playerEntity, button), which re-derives the enchantment from the table's seed, validates the lapis and level cost against the real player state, applies the enchantment and calls detectAndSendChanges. Every cost check is server-side; the packet carries nothing but the two bytes.
Why clients touch it
There is no AutoEnchant module in the corpus; the hits are all plumbing. Rise 6.1.30 and Rise 6.2.4 expose sendEnchantItem in the script PacketAPI, Tenacity 6.0 lists C11 in PacketUtil.isClientPacket, and November Recode 2.0 maps C11PacketEnchantItem to wire id 0x11 in LuaEventPacket so its Lua scripting API can identify the packet by id instead of by class. Enchanting in all of these clients goes through the vanilla GUI, so the packet is never intercepted for spoofing.
Exploit surface
The server re-validates everything, so the packet itself cannot grant free enchants; the historical abuse is ordering, not content. A client that clicks an enchant and a C0E window action in the same tick can race the slot sync, which is the dupe-era vector. Because the button byte indexes the table's three server-side options, sending a button with no matching cost is harmless: enchantItem simply fails the level check. Anti-cheats ignore C11 entirely.
Server-Side Handling
processEnchantItem: window id match, canCraft check, spectator rejection, then Container.enchantItem which re-validates lapis and XP server-side. detectAndSendChanges pushes S2FPacketSetSlot with the enchanted stack. No rate limit beyond the container state machine.
Protocol Analysis
byte windowId + byte button on the wire. Valid only while an EnchantmentTable container is open; any other container makes the window id check fail. The button maps to the table's three server-side options, which are deterministic from the world seed and player position.
Anti-Cheat Landscape
No anti-cheat measures C11; the packet is fully server-validated and carries no movement or timing signal. The only server-side observable is the ordering relative to C0E transactions during rapid enchanting.
implementation Implementation Cases
The enchanting-table selection packet. Zero modules in the corpus drive it; the hits are the Rise 6.x script PacketAPI enchant bridge, Tenacity's silent-send whitelist and November Recode 2.0's Lua packet-id map.
Expose C11 construction to the scripting layer so scripts can select enchantments programmatically.
sendEnchantItem(windowId, enchantment) and sendEnchantItem(enchantment) build the packet and send it via PacketUtil.send; the overload without a window id reads thePlayer.openContainer.windowId at call time.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/script/api/PacketAPI.java =====
package com.alan.clients.script.api;
import com.alan.clients.Client;
import com.alan.clients.component.impl.player.Slot;
import com.alan.clients.script.api.wrapper.impl.ScriptEntity;
import com.alan.clients.script.api.wrapper.impl.ScriptItemStack;
import com.alan.clients.script.api.wrapper.impl.vector.ScriptVector3d;
import com.alan.clients.util.packet.PacketUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.network.play.client.*;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Vec3;
public class PacketAPI extends API {
public void sendKeepAlive(final int key) {
PacketUtil.send(new C00PacketKeepAlive(key));
}
public void sendMessage(final String message) {
PacketUtil.send(new C01PacketChatMessage(message));
}
public void sendUseEntity(final ScriptEntity entity, final String action) {
sendUseEntity(entity.getEntityId(), action);
}
public void sendUseEntity(final int entityID, final String action) {
PacketUtil.send(new C02PacketUseEntity(Minecraft.getMinecraft().theWorld.getEntityByID(entityID),
C02PacketUseEntity.Action.valueOf(action)));
}
public void sendUseEntity(final int entityID, ScriptVector3d vector) {
PacketUtil.send(new C02PacketUseEntity(Minecraft.getMinecraft().theWorld.getEntityByID(entityID),
new Vec3(vector.getX(), vector.getY(), vector.getZ())));
}
public void sendUseEntity(final ScriptEntity entity, ScriptVector3d vector) {
sendUseEntity(entity.getEntityId(), vector);
}
public void sendPosition(boolean ground) {
PacketUtil.send(new C03PacketPlayer(ground));
}
public void sendPosition(double x, double y, double z, boolean ground) {
PacketUtil.send(new C03PacketPlayer.C04PacketPlayerPosition(x, y, z, ground));
}
public void sendPosition(double x, double y, double z, float yaw, float pitch, boolean ground) {
PacketUtil.send(new C03PacketPlayer.C06PacketPlayerPosLook(x, y, z, yaw, pitch, ground));
}
public void sendDigging(String status, ScriptVector3d vector3d, String facing) {
PacketUtil.send(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.valueOf(status),
new BlockPos(vector3d.getX(), vector3d.getY(), vector3d.getZ()), EnumFacing.valueOf(facing)));
}
public void sendPlacement() {
PacketUtil.send(new C08PacketPlayerBlockPlacement(Client.INSTANCE.getComponentManager().get(Slot.class).getItemStack()));
}
public void sendPlacement(ScriptVector3d vector3d, int direction, float x, float y, float z) {
PacketUtil.send(new C08PacketPlayerBlockPlacement(new BlockPos(vector3d.getX(), vector3d.getY(), vector3d.getZ()),
direction, Client.INSTANCE.getComponentManager().get(Slot.class).getItemStack(), x, y, z));
}
public void sendPlacement(ScriptVector3d vector3d, int direction, ScriptItemStack itemStack, float x, float y, float z) {
PacketUtil.send(new C08PacketPlayerBlockPlacement(new BlockPos(vector3d.getX(), vector3d.getY(), vector3d.getZ()),
direction, itemStack.getWrapped(), x, y, z));
}
public void sendChangeItem(int slot) {
PacketUtil.send(new C09PacketHeldItemChange(slot));
}
public void sendAnimation(int entityID, String animation) {
PacketUtil.send(new C0APacketAnimation());
}
public void sendEntityAction(int entityID, String action) {
PacketUtil.send(new C0BPacketEntityAction(Minecraft.getMinecraft().theWorld.getEntityByID(entityID),
C0BPacketEntityAction.Action.valueOf(action)));
}
public void sendInput(final float strafeSpeed, final float forwardSpeed, final boolean jumping, final boolean sneaking) {
PacketUtil.send(new C0CPacketInput(strafeSpeed, forwardSpeed, jumping, sneaking));
}
public void sendCloseWindow(int windowId) {
PacketUtil.send(new C0DPacketCloseWindow(windowId));
}
public void sendCloseWindow() {
PacketUtil.send(new C0DPacketCloseWindow(Minecraft.getMinecraft().thePlayer.openContainer.windowId));
}
public void sendEnchantItem(int windowId, int enchantment) {
PacketUtil.send(new C11PacketEnchantItem(windowId, enchantment));
}
public void sendEnchantItem(int enchantment) {
PacketUtil.send(new C11PacketEnchantItem(Minecraft.getMinecraft().thePlayer.openContainer.windowId, enchantment));
}
public void sendTransaction(int windowId, short actionNumber, boolean accepted) {
PacketUtil.send(new C0FPacketConfirmTransaction(windowId, actionNumber, accepted));
}
public void sendAbilities() {
PacketUtil.send(new C13PacketPlayerAbilities(Minecraft.getMinecraft().thePlayer.capabilities));
}
public void sendAbilities(boolean flying, boolean allowFlying, boolean creativeMode) {
PlayerCapabilities capabilities = new PlayerCapabilities();
capabilities.isFlying = flying;
capabilities.allowFlying = allowFlying;
capabilities.isCreativeMode = creativeMode;
PacketUtil.send(new C13PacketPlayerAbilities(capabilities));
}
public void sendTabComplete(String message) {
PacketUtil.send(new C14PacketTabComplete(message));
}
public void sendTabComplete(String message, ScriptVector3d vector3d) {
PacketUtil.send(new C14PacketTabComplete(message, new BlockPos(vector3d.getX(), vector3d.getY(), vector3d.getZ())));
}
public void sendStatus(String status) {
PacketUtil.send(new C16PacketClientStatus(C16PacketClientStatus.EnumState.valueOf(status)));
}
public void sendSettings() {
PacketUtil.send(new C15PacketClientSettings());
}
}
// NOTE (AI): PacketAPI is the Rise 6.x scripting bridge. sendEnchantItem(windowId, enchantment) and the windowId-less overload construct C11 and push it through PacketUtil.send. The file also exposes sendAbilities, sendTabComplete and sendSettings, which is why the same class is the representative file for C13, C14 and C15. Note the enchant overload defaults to thePlayer.openContainer.windowId, mirroring the vanilla GuiEnchantment path.Classify C11 as a legitimate client packet for Tenacity's packet routing helpers.
isClientPacket includes C11PacketEnchantItem in the full play-state whitelist.
// ===== FILE: Tenacity 6.0, dev/tenacity/util/network/PacketUtil.java =====
package dev.tenacity.util.network;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.*;
public final class PacketUtil {
private PacketUtil() {
}
// This is just temporary, as for some reason packet send event allows server packets as well.
public static boolean isClientPacket(final Packet<?> packet) {
return packet instanceof C0APacketAnimation
|| packet instanceof C0BPacketEntityAction
|| packet instanceof C0CPacketInput
|| packet instanceof C0DPacketCloseWindow
|| packet instanceof C0EPacketClickWindow
|| packet instanceof C0FPacketConfirmTransaction
|| packet instanceof C00PacketKeepAlive
|| packet instanceof C01PacketChatMessage
|| packet instanceof C02PacketUseEntity
|| packet instanceof C03PacketPlayer
|| packet instanceof C07PacketPlayerDigging
|| packet instanceof C08PacketPlayerBlockPlacement
|| packet instanceof C09PacketHeldItemChange
|| packet instanceof C10PacketCreativeInventoryAction
|| packet instanceof C11PacketEnchantItem
|| packet instanceof C12PacketUpdateSign
|| packet instanceof C13PacketPlayerAbilities
|| packet instanceof C14PacketTabComplete
|| packet instanceof C15PacketClientSettings
|| packet instanceof C16PacketClientStatus
|| packet instanceof C17PacketCustomPayload
|| packet instanceof C18PacketSpectate
|| packet instanceof C19PacketResourcePackStatus;
}
}
// NOTE (AI): Same whitelist as the C10 page: C11PacketEnchantItem is classified as a client packet in isClientPacket so Tenacity's send helpers accept it. There is no enchant-specific module in Tenacity; the reference is purely the routing gate.Expose the serverbound packet id space to the Lua scripting API: scripts receive a numeric packet id instead of the raw class.
A static block maps every serverbound play packet class to its 1.8.9 wire id, C11PacketEnchantItem to 0x11. The constructor resolves the id from the EventPacket payload via getOrDefault (falling back to -1) and stamps a direction string ('out' for EventPacket.Out, 'in' otherwise); Lua event wrappers then pass the id and direction to scripts. The source comment explains the map exists because runtime obfuscation would break reflection-based lookups.
// ===== FILE: November Recode 2.0, scripting/wrapper/event/LuaEventPacket.java =====
/* November.lol © 2023 */
package lol.november.scripting.wrapper.event;
import java.util.HashMap;
import java.util.Map;
import lol.november.listener.event.net.EventPacket;
import lol.november.protect.DontObfuscate;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.*;
/**
* @author Gavin
* @since 2.0.0
*/
@Getter
@Setter
@DontObfuscate
public class LuaEventPacket {
/**
* A map of each {@link Packet} to their id
*/
private static final Map<Class<? extends Packet<?>>, Integer> packetIds =
new HashMap<>();
static {
// you may ask: why not use reflection and just.. do a funny?
// obfuscation eventually happens so this aids has to happen
packetIds.put(C0APacketAnimation.class, 0x0A);
packetIds.put(C0BPacketEntityAction.class, 0x0B);
packetIds.put(C0CPacketInput.class, 0x0C);
packetIds.put(C0DPacketCloseWindow.class, 0x0D);
packetIds.put(C0EPacketClickWindow.class, 0x0E);
packetIds.put(C0FPacketConfirmTransaction.class, 0x0F);
packetIds.put(C00PacketKeepAlive.class, 0x00);
packetIds.put(C01PacketChatMessage.class, 0x01);
packetIds.put(C02PacketUseEntity.class, 0x02);
packetIds.put(C03PacketPlayer.class, 0x03);
packetIds.put(C03PacketPlayer.C04PacketPlayerPosition.class, 0x04);
packetIds.put(C03PacketPlayer.C05PacketPlayerLook.class, 0x05);
packetIds.put(C03PacketPlayer.C06PacketPlayerPosLook.class, 0x06);
packetIds.put(C07PacketPlayerDigging.class, 0x07);
packetIds.put(C08PacketPlayerBlockPlacement.class, 0x08);
packetIds.put(C09PacketHeldItemChange.class, 0x09);
packetIds.put(C10PacketCreativeInventoryAction.class, 0x10);
packetIds.put(C11PacketEnchantItem.class, 0x11);
packetIds.put(C12PacketUpdateSign.class, 0x12);
packetIds.put(C13PacketPlayerAbilities.class, 0x13);
packetIds.put(C14PacketTabComplete.class, 0x14);
packetIds.put(C15PacketClientSettings.class, 0x15);
packetIds.put(C16PacketClientStatus.class, 0x16);
packetIds.put(C17PacketCustomPayload.class, 0x17);
packetIds.put(C18PacketSpectate.class, 0x18);
packetIds.put(C19PacketResourcePackStatus.class, 0x19);
}
private final int packet;
private final String direction;
public LuaEventPacket(EventPacket event) {
packet = packetIds.getOrDefault(event.get().getClass(), -1);
direction = event.get() instanceof EventPacket.Out ? "out" : "in";
}
}
// NOTE (AI): November Recode 2.0's Lua packet wrapper: the whole serverbound play id space is hard-coded in one static block because obfuscation kills reflection. C11PacketEnchantItem maps to 0x11, which matches the 1.8.9 protocol. The wrapper is read-only visibility for scripts: no packet is constructed, sent or cancelled here. The direction stamp distinguishes outbound EventPacket.Out from inbound events.
anticheat Anti-Cheat Checks
No anticheat in the 50-repo corpus implements a check on the enchant-item packet. The corpus hits are enchantment-attribute reads (depth strider, soul speed, efficiency, knockback) used by movement, fight and block-break checks, plus packet-type registrations in Negativity and Artemis wrappers. Server-side anticheats do not watch the enchantment-table interaction, so this packet is invisible to them.
Related Packets
Wiki Cross-Reference
Two bytes: windowId plus button 0 top, 1 middle, 2 bottom; PLAY serverbound 0x11.
Accepted only when the id matches the open container and it can craft; spectators are rejected.
Server re-derives cost from seed, lapis and XP, so a bare button cannot grant free enchants.
MCP 1.8.9 C11PacketEnchantItem implements Packet
1.8.9 callers: PlayerControllerMP.sendEnchantPacket sends new C11PacketEnchantItem (line 551): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java
Cross-checked against minecraft.wiki (CC BY-SA 3.0) for 1.8.9 accuracy.
Vanilla Internals
Full 1.8.9 logic-class sources that send or handle this packet, stored verbatim.