0x11 C11PacketEnchantItem

Player selects an enchantment option in the enchanting table window. Carries window ID and button (0=top, 1=middle, 2=bottom).

Serverbound (Client → Server) · PLAY · net/minecraft/network/play/client/C11PacketEnchantItem.java

Published 2026-06-18 · Updated 2026-10-14

playerenchantcontainer
Comprehensive 8/8

Fields

FieldTypeDescription
windowIdbyteEnchantment table window ID
buttonbyteEnchantment slot (0=top, 1=middle, 2=bottom)

Wire Encoding

FieldTypeNotes
Window IDbyte
Enchantmentbyte0=top, 1=middle, 2=bottom

MCP References

MCPNetHandlerPlayServer.processEnchantItem()

Handler Interface

HNDINetHandlerPlayServer

Notes

The server responds with S2FPacketSetSlot (enchanted item). The server validates the lapis lazuli count and XP level before applying. No major client module specifically targets this packet in the 6+ client codebases examined, and enchantment is handled through vanilla GUI mechanics.

Vanilla Source

C11PacketEnchantItem.java58 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.play.client;
2
3
import java.io.IOException;
4
import net.minecraft.network.Packet;
5
import net.minecraft.network.PacketBuffer;
6
import net.minecraft.network.play.INetHandlerPlayServer;
7
8
public class C11PacketEnchantItem implements Packet<INetHandlerPlayServer>
9
{
10
    private int windowId;
11
    private int button;
12
13
    public C11PacketEnchantItem()
14
    {
15
    }
16
17
    public C11PacketEnchantItem(int windowId, int button)
18
    {
19
        this.windowId = windowId;
20
        this.button = button;
21
    }
22
23
    /**
24
     * Passes this Packet on to the NetHandler for processing.
25
     */
26
    public void processPacket(INetHandlerPlayServer handler)
27
    {
28
        handler.processEnchantItem(this);
29
    }
30
31
    /**
32
     * Reads the raw packet data from the data stream.
33
     */
34
    public void readPacketData(PacketBuffer buf) throws IOException
35
    {
36
        this.windowId = buf.readByte();
37
        this.button = buf.readByte();
38
    }
39
40
    /**
41
     * Writes the raw packet data to the data stream.
42
     */
43
    public void writePacketData(PacketBuffer buf) throws IOException
44
    {
45
        buf.writeByte(this.windowId);
46
        buf.writeByte(this.button);
47
    }
48
49
    public int getWindowId()
50
    {
51
        return this.windowId;
52
    }
53
54
    public int getButton()
55
    {
56
        return this.button;
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.

PacketAPI (script bridge) (Rise 6.1.30, Rise 6.2.4)

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.

Source: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/script/api/PacketAPI.java

Vanilla hook: No event hook; direct PacketUtil.send from script code.
None. The server re-validates the selection, so scripts gain convenience, not an exploit.
Variations: Identical PacketAPI.java exists in Rise 6.1.30 with the same method bodies.
PacketUtil (silent whitelist) (Tenacity 6.0)

Classify C11 as a legitimate client packet for Tenacity's packet routing helpers.

isClientPacket includes C11PacketEnchantItem in the full play-state whitelist.

Source: Tenacity 6.0, dev/tenacity/util/network/PacketUtil.java

Vanilla hook: Packet send helper, no event hook.
None.
Variations: Same whitelist pattern as C10; the file covers every serverbound play packet.
LuaEventPacket (script bridge) (November Recode 2.0)

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.

Source: November Recode 2.0, scripting/wrapper/event/LuaEventPacket.java

Vanilla hook: EventPacket.In/Out bus events translated into the Lua wrapper; no packet is constructed or sent here.
None: the wrapper only reads the packet class. Scripts that want to drive C11 still go through vanilla methods; the map is visibility, not control.
Variations: Parallel to Rise 6.x's PacketAPI sendEnchantItem bridge, but November Recode 2.0 only identifies packets; it does not expose a send helper for enchanting.
No module hooks C11 in the corpus; scripting access goes through PacketAPI (Rise 6.x) or the LuaEventPacket wrapper (November Recode 2.0), not packet events.
Rise 6.x exposes it in the script API; Tenacity classifies it in a helper; November Recode 2.0 maps it in the Lua wrapper. Memeware, Nekoware, Sigma, Spicy, Rise 5.99 and Tenacity all send it only via the vanilla PlayerControllerMP.enchantItem path.

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.

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 dispatching to INetHandlerPlayServer.processEnchantItem; wire serde is readPacketData/writePacketData via readByte.

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.