0x09 C09PacketHeldItemChange

Player changes their selected hotbar slot.

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

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

playerinventoryitem
Comprehensive 7/8

Fields

FieldTypeDescription
slotIdshortThe hotbar slot being selected (0-8)

Wire Encoding

FieldTypeNotes
Slot IDshortHotbar slot 0-8

MCP References

MCPNetHandlerPlayServer.processHeldItemChange()

Handler Interface

HNDINetHandlerPlayServer

Vanilla Source

C09PacketHeldItemChange.java49 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 C09PacketHeldItemChange implements Packet<INetHandlerPlayServer>
9
{
10
    private int slotId;
11
12
    public C09PacketHeldItemChange()
13
    {
14
    }
15
16
    public C09PacketHeldItemChange(int slotId)
17
    {
18
        this.slotId = slotId;
19
    }
20
21
    /**
22
     * Reads the raw packet data from the data stream.
23
     */
24
    public void readPacketData(PacketBuffer buf) throws IOException
25
    {
26
        this.slotId = buf.readShort();
27
    }
28
29
    /**
30
     * Writes the raw packet data to the data stream.
31
     */
32
    public void writePacketData(PacketBuffer buf) throws IOException
33
    {
34
        buf.writeShort(this.slotId);
35
    }
36
37
    /**
38
     * Passes this Packet on to the NetHandler for processing.
39
     */
40
    public void processPacket(INetHandlerPlayServer handler)
41
    {
42
        handler.processHeldItemChange(this);
43
    }
44
45
    public int getSlotId()
46
    {
47
        return this.slotId;
48
    }
49
}

Deobfuscated MCP 1.8.9 source of C09PacketHeldItemChange, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/client/C09PacketHeldItemChange.java) at build time and verified present.

Deep Dive

Role in the protocol

C09 carries one int: the hotbar slot index the client is switching to. The server's processHeldItemChange validates 0 <= slot < 9 and sets the player's currentItem, which changes the server-side held item used for reach, damage, block breaking and what other players see. It is the cheapest stateful packet in the play state: no position, no timestamp, so clients can spam it freely, which is exactly why silent-switch modules rely on it.

Vanilla handling

NetHandlerPlayServer.processHeldItemChange: if the slot is within the hotbar, set inventory.currentItem and mark the player active; otherwise log a warning. The client-side vanilla path is EntityPlayerSP/PlayerControllerMP updating the slot when the user scrolls. Because the server trusts the packet entirely, any module that sends C09 with a different slot than the visible one desynchronizes the server's view of the held item.

Why clients touch it

Three families across the ten clients. (1) Silent switching: Scaffold (Tenacity ScaffoldModule, Rise 5.99 Scaffold, Sigma Scaffold) sends C09 to the block slot while the visible hotbar stays put, and cancels incoming C09 echoes. (2) Tool/weapon automation: Rise 6.2.4 NewNewBreaker switches to the best tool before breaking, KillAura (Rise 6.2.4/6.1.30) swaps weapons for 1.9+ style switching. (3) Consumable routing: AutoPotion/AutoSoup/AutoGap/AutoHead/AutoEat (Memeware, Rise 5.99, Sigma) switch to the food/potion slot, use the item, then switch back. November Recode 2.0 adds an InventoryManager that tracks the C09/S09 streams and re-syncs the slot, and a NoSlowDown that switches away and back; LiquidSense Dev's AutoHead, AutoArmor, AutoADL and the NoFall MLG save all use the silent-switch pair.

Exploit surface

The packet is unthrottled, so modules can switch slots 20 times per tick. The detectability comes from the server comparing the packet slot to the client's own S09PacketHeldItemChange echoes and to attack/place packets: an aura that attacks with a sword while C09 says a block is held gets flagged by rotation+slot correlation checks. Silent switch modules therefore cancel the visible slot change or re-send it after the action.

Server-Side Handling

processHeldItemChange validates the slot range and sets inventory.currentItem. There is no rate limit and no validation against the client's last known slot. The side effect is that the server-side held item drives entity equipment broadcasts (S04PacketEntityEquipment) and the player's attack/place behavior.

Protocol Analysis

Single VarInt slot field. Sent in PLAY state only. Vanilla sends it on scroll wheel input; modules send it via PacketUtil.sendPacket, addToSendQueue, or addToSendQueueNoEvent (Tenacity). Silent-switch modules cancel the packet when it matches the player's real current slot so the visible hotbar never moves.

Anti-Cheat Landscape

Anti-cheats correlate C09 with C02/C08/C07: switching to a sword then attacking with reach is normal, but attacking while the C09 stream says a block is held trips slot-consistency checks on Verus and newer NCP. The fix in clients is to send C09 to the weapon slot before the attack and back after, or to cancel the switch entirely and spoof the attack slot.

implementation Implementation Cases

The slot-switch packet that silent everything depends on. Scaffold switches to blocks invisibly, breakers grab the best tool, and consumable modules hop to the potion slot and back. The server trusts the int, so the entire game is keeping the visible slot in sync with the action slot.

Scaffold (silent switch) (Tenacity 6.0, Rise 5.99, Sigma 4.11, November Recode 2.0, LiquidSense Dev)

Switch the server-side held item to the block slot without moving the visible hotbar.

Tenacity ScaffoldModule sends C09 to the target slot via addToSendQueueNoEvent (line ~80), cancels incoming C09 packets that would reveal the switch (line ~150), and restores the original slot with a second C09 (line ~183). Rise 5.99 Scaffold sends C09 only when the computed block slot differs from the player's current slot, and cancels all C09 on the send event.

Source: Tenacity 6.0, dev/tenacity/module/impl/player/ScaffoldModule.java

Vanilla hook: MotionEvent for placement + switch; PacketSendEvent to cancel C09 echoes.
The visible-hotbar cancellation makes the server see a different slot than spectators; servers that mirror S09 back detect the mismatch. Block placement with a silently-switched slot is otherwise indistinguishable from a scroll.
Variations: Rise 5.99 Scaffold.java sends C09 through PacketUtil.sendPacketWithoutEvent and cancels all C09 in onPacketSend; Sigma 4.11 Scaffold.java includes its own switch logic. Rise 6.2.4/6.1.30 Scaffold do not construct C09 directly (Slot component + custom packets). November Recode 2.0's ScaffoldModule switches to the block slot through the raw send queue (guarded by InventoryManager.slot()) and restores via InventoryManager.sync() on disable. LiquidSense Dev's Scaffold sends C09 to the block slot before the placement, intercepts incoming C09 echoes on its packet event, and switches back after the place.
NewNewBreaker (AutoTool) (Rise 6.2.4, Rise 6.1.30)

Break blocks (including through walls) while automatically switching to the best tool via C09.

Finds the target block with a raycast or surroundings scan, computes the best tool slot with SlotUtil, sends C09 to that slot, digs with C07, then switches back to the original slot. On attack events it also swaps to the weapon slot. The breaker mode determines target selection (Through Walls / Surroundings).

Source: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/player/NewNewBreaker.java

Vanilla hook: PreUpdateEvent for digging; AttackEvent for weapon switch; PacketUtil.send for C09.
Rapid tool switching followed by instant block break is the classic nuker signature; Watchdog checks break speed vs tool tier. The module is primarily aimed at bed/obsidian breaking on HCF servers where fast break is expected.
Variations: Rise 6.1.30 ships the same module. KillAura in Rise 6.2.4/6.1.30 also sends C09 pairs (lines ~897-921, ~1018-1019) for weapon switching during attacks.
AutoSoup / AutoPot (slot routing) (Memeware 7.3, Rise 5.99, Sigma 4.11, November Recode 2.0)

Switch to the soup/potion slot, consume, and return to the combat slot, all with C09.

On low health, find a soup/potion in the hotbar or inventory, send C09 to that slot, send the C08 use packet, then send C09 back to the original slot. Memeware AutoSoup also sends C07 RELEASE_USE_ITEM and calls stopUsingItem to end the eat state cleanly so the server does not keep the player stuck eating.

Source: Memeware 7.3, me/memewaredevs/client/module/combat/AutoSoup.java

Vanilla hook: UpdateEvent; direct sendQueue.addToSendQueue for C09/C08/C07.
Soup servers expect rapid eating, so the switch-eat-switch pattern is usually under the radar there; on vanilla combat servers the instant eat is flagged by consumption-timer checks.
Variations: Memeware AutoPotion mirrors it for splash potions; Rise 5.99 AutoPot/AutoSoup/AutoGap/AutoHead send C09 via PacketUtil; Sigma AutoPot/AutoSoup/AutoGApple/AutoEat do the same on their event bus. November Recode 2.0's AutoPotModule sends C09 to the potion slot, fires the C08 use, waits for S1DPacketEntityEffect, then calls InventoryManager.sync() to restore the combat slot.
InventoryManager (November Recode 2.0)

Track the server-visible hotbar slot from the C09 and S09 streams and re-sync the slot when modules desync it.

EventPacket.Out records the slot from every outgoing C09; EventPacket.In records it from every S09 echo. sync() re-sends C09 with the real currentItem when the tracked slot diverges, which is how AutoPot and AutoPlay restore the hotbar after their silent switches.

Source: November Recode 2.0, management/inventory/InventoryManager.java

Vanilla hook: EventPacket.Out (C09), EventPacket.In (S09).
Keeping the tracked slot equal to the real hotbar slot prevents slot-consistency checks from seeing a phantom held item between a module switch and its restore.
Variations: LiquidSense Dev has no equivalent singleton; its Scaffold and Tower track the slot locally.
AutoHead (LiquidSense Dev)

Packet-eat golden heads: C09 to the head slot, the C08 use, C09 back to the combat slot.

Below the health threshold with no mouse held, find a head (id 397) in the hotbar, then send the C09/C08/C09 triple with a delay gate; golden apples use the key-binding path instead.

Source: LiquidSense Dev, me/AquaVit/liquidSense/modules/combat/AutoHead.java

Vanilla hook: MotionEvent; C09 pair via sendQueue.addToSendQueue.
The switch pair is instant, but the consume rate is the flag surface; the delay gate keeps it near human eat speed.
Variations: Same file backs the C08 entry; November's AutoPot runs the same switch-use-restore shape through InventoryManager.
AutoArmor (LiquidSense Dev)

Switch to the armor-hotbar slot with C09 for the C08 equip placement, then switch back.

move() with a hotbar item sends C09(item), C08(placement with the slot's stack), C09(current); non-hotbar items use the window-click path. Gated by InventoryUtils.CLICK_TIMER and a random delay.

Source: LiquidSense Dev, net/ccbluex/liquidbounce/features/module/modules/combat/AutoArmor.java

Vanilla hook: Render3DEvent; C09 pair via getNetHandler().addToSendQueue.
The switch pair is invisible to slot checks because the equip placement follows the switch in the same tick and the restore is immediate.
Variations: Same file backs the C08 entry.
AutoADL (LiquidSense Dev)

Silently flash an iron sword slot that carries a single Sharpness II enchantment and a custom lore, using a C09 pair.

Every update, scan the hotbar NBT for an iron sword with exactly one enchantment (id 16, level 2) and a display Lore tag, then send C09(slot) followed by C09(current) back-to-back.

Source: LiquidSense Dev, me/AquaVit/liquidSense/modules/misc/AutoADL.java

Vanilla hook: UpdateEvent; sendQueue.addToSendQueue.
The module is a glitch trigger aimed at a specific server item state; the rapid slot flash is otherwise a slot-consistency tell.
Variations: Only LiquidSense Dev in the corpus; nothing in the eight original clients matches this niche.
NoFall (MLG) (LiquidSense Dev)

MLG save: switch to a water bucket or web block with C09 when a fall would miss the ground, place it, then switch back.

When the fall would end without ground and a collision is found below, find water_bucket or web in the hotbar, send C09(index), place via sendUseItem or onPlayerRightClick, then send C09(current) back. The rest of the file is the onGround spoof family documented in the C03 impl.

Source: LiquidSense Dev, net/ccbluex/liquidbounce/features/module/modules/player/NoFall.java

Vanilla hook: UpdateEvent; C09 via sendQueue.addToSendQueue.
The switch-place-restore is a single human-looking action sequence; the tell is the bucket appearing in the hotbar before the fall ends.
Variations: Same file backs the C03 NoFall entry, where the onGround spoof modes are the primary behavior.
MotionEvent/UpdateEvent for the switch decision; PacketSendEvent in silent-switch modules to cancel C09 echoes; sendQueue/PacketUtil for the actual send.
Tenacity uses addToSendQueueNoEvent to bypass its own event bus. Rise 5.99 uses PacketUtil.sendPacketWithoutEvent. Memeware/Sigma push raw packets to the send queue. Rise 6.x routes through PacketUtil.send and the Slot component, and its PingSpoofComponent parks C09 in the blink packet class list.

anticheat Anti-Cheat Checks

The held item change packet reports the new hotbar slot. It is a thin packet, but it is the trigger for autotool, fastswitch and slot desync checks. Autotool modules switch to the best tool right before a block break or attack, so the switch timing relative to dig and use-entity packets is the signal. The slot value itself must be in range 0 to 8, and the change must match the server's view of the player's inventory, which makes out-of-range and repeated-identical-slot checks cheap and effective.

Fastswitch (Photon) (Photon-GitHub-AntiCheatAddition)

Flags hotbar switches that are faster than humanly possible while the player is in combat or using an item.

Listens to PlayerItemHeldEvent. It first allows scroll-like changes, adjacent slots or a 0 to 8 wrap, so fast scrolling is not flagged. If the switch is non-adjacent, TPS is at least 19, ping is below the max (default 400), the last switch happened within 50 ms, and the player did something combat- or item-related in the last 750 ms, it flags with +25 VL and cancels the event at 50 VL, otherwise syncing the inventory. Violation decays 25 per 120 seconds.

Detects: Fastswitch and autotool modules that swap to a tool and act within the same tick.

Source: Photon-GitHub-AntiCheatAddition, src/main/java/de/photon/anticheataddition/modules/checks/fastswitch/Fastswitch.java

Variations: Intave ToolSwitchHeuristic flags slot changes within one tick of a block break; Kauri SlotChange flags repeated identical slot packets; BetterAnticheat ImpossibleSlotCheck only checks the slot range.
SlotChange (Kauri) (funkemunky-KauriV3)

Flags client-held slot changes that repeat the same slot without a server-side slot change in between.

Two WActions: one on WrapperPlayClientHeldItemChange, one on WrapperPlayServerHeldItemChange. When the server sends a slot change, didServerSlot is set and the next client change is accepted as the echo. Otherwise a client change that equals the last slot increments a buffer that flags at 6 and decays by 3 on a legitimate change. This catches clients that spam the held-item packet to desync the server's hand tracking.

Detects: Slot desync abuse and clients that replay held-item packets to confuse inventory tracking.

Source: funkemunky-KauriV3, Anticheat/src/main/java/dev/brighten/ac/check/impl/packet/badpackets/SlotChange.java

Variations: Grim BadPacketsY and BetterAnticheat ImpossibleSlotCheck only validate the range; Photon Fastswitch and Intave ToolSwitchHeuristic look at timing instead.
ImpossibleSlotCheck (BetterAnticheat) (amnoah-BetterAnticheat)

Fails any held item change whose slot is outside the hotbar range 0 to 8.

handleReceivePlayPacket matches HELD_ITEM_CHANGE, decodes WrapperPlayClientHeldItemChange and fails when the slot is below 0 or above 8. The comment notes those values are physically impossible to send from the vanilla client.

Detects: Out-of-range slot packets from modified clients or crash attempts.

Source: amnoah-BetterAnticheat, core/src/main/java/better/anticheat/core/check/impl/misc/ImpossibleSlotCheck.java

Variations: Grim BadPacketsY is the same range check with packet cancellation; Kauri SlotChange and Photon Fastswitch check repetition and timing.
BadPacketsY (Grim) (GrimAnticheat-Grim)

Cancels held item change packets carrying out-of-bounds slot ids before they reach the server.

PreViaPacketReceiveListener on HELD_ITEM_CHANGE: decodes the slot and, if it is greater than 8 or below 0, flags with the slot in the verbose data, cancels the packet and calls onPacketCancel so the inventory state stays coherent.

Detects: Out-of-range slot ids from modified clients and crash attempts.

Source: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsY.java

Variations: BetterAnticheat ImpossibleSlotCheck flags the same condition; Kauri SlotChange targets repeated in-range slots instead.
ToolSwitchHeuristic (Intave) (intave-intave)

Flags slot changes made within one tick of starting and stopping a block break, the autotool signature.

ClassicHeuristic subscribed to movement packets, which tick counters, BLOCK_DIG for break start and stop, and HELD_ITEM_SLOT_IN. If a slot change arrives within one tick after START_DESTROY_BLOCK and the player stops digging within one tick, the heuristic marks it suspicious and, when the switched slot equals the last one, accumulates a violation that flags at 4. Repeated offenses apply the DMG_LIGHT attack nerf.

Detects: Autotool modules that swap to the correct tool exactly when breaking starts.

Source: intave-intave, src/main/java/de/jpx3/intave/check/combat/heuristics/other/ToolSwitchHeuristic.java

Variations: Photon Fastswitch detects the switch speed near combat actions; Kauri SlotChange detects desync spam; Grim tracks slot changes in CompensatedInventory for its break speed checks.

Wiki Cross-Reference

Wire field is a 2-byte short slot 0-8 (readShort/writeShort), stored as int in the 1.8.9 class.

PLAY serverbound 0x09; server checks 0-8 then sets currentItem and rebroadcasts the held equipment.

Vanilla sends on scroll; modules spoof it for silent switching without moving the visible hotbar.

MCP 1.8.9 C09PacketHeldItemChange implements Packet dispatching to INetHandlerPlayServer.processHeldItemChange; wire serde is readPacketData/writePacketData via readShort.

1.8.9 callers: PlayerControllerMP.syncCurrentPlayItem sends new C09PacketHeldItemChange (line 386): 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.