0x0A S0APacketUseBed

Makes the player lie down in a bed at the specified position.

Clientbound (Server → Client) · PLAY · net/minecraft/network/play/server/S0APacketUseBed.java

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

playerbedanimation
Complete 6/8

Fields

FieldTypeDescription
playerVarIntPlayer entity ID
bedPosBlockPosBed block position

Wire Encoding

FieldTypeNotes
Entity IDVarInt
Bed PositionBlockPos (long)

MCP References

MCPNetHandlerPlayClient.handleUseBed()

Handler Interface

HNDINetHandlerPlayClient

Vanilla Source

S0APacketUseBed.java63 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.entity.player.EntityPlayer;
5
import net.minecraft.network.Packet;
6
import net.minecraft.network.PacketBuffer;
7
import net.minecraft.network.play.INetHandlerPlayClient;
8
import net.minecraft.util.BlockPos;
9
import net.minecraft.world.World;
10
11
public class S0APacketUseBed implements Packet<INetHandlerPlayClient>
12
{
13
    private int playerID;
14
15
    /** Block location of the head part of the bed */
16
    private BlockPos bedPos;
17
18
    public S0APacketUseBed()
19
    {
20
    }
21
22
    public S0APacketUseBed(EntityPlayer player, BlockPos bedPosIn)
23
    {
24
        this.playerID = player.getEntityId();
25
        this.bedPos = bedPosIn;
26
    }
27
28
    /**
29
     * Reads the raw packet data from the data stream.
30
     */
31
    public void readPacketData(PacketBuffer buf) throws IOException
32
    {
33
        this.playerID = buf.readVarIntFromBuffer();
34
        this.bedPos = buf.readBlockPos();
35
    }
36
37
    /**
38
     * Writes the raw packet data to the data stream.
39
     */
40
    public void writePacketData(PacketBuffer buf) throws IOException
41
    {
42
        buf.writeVarIntToBuffer(this.playerID);
43
        buf.writeBlockPos(this.bedPos);
44
    }
45
46
    /**
47
     * Passes this Packet on to the NetHandler for processing.
48
     */
49
    public void processPacket(INetHandlerPlayClient handler)
50
    {
51
        handler.handleUseBed(this);
52
    }
53
54
    public EntityPlayer getPlayer(World worldIn)
55
    {
56
        return (EntityPlayer)worldIn.getEntityByID(this.playerID);
57
    }
58
59
    public BlockPos getBedPosition()
60
    {
61
        return this.bedPos;
62
    }
63
}

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

Deep Dive

Role in the protocol

S0A tells clients that a player went to sleep: a VarInt entity id and a BlockPos for the bed. The server sends it from EntityPlayerMP.sleepInBedAt and re-broadcasts it through EntityTrackerEntry to everyone tracking the sleeper. The client renders the sleeping pose; the matching wake-up arrives as S0BPacketAnimation type 2 (leave bed).

Vanilla handling

NetHandlerPlayClient.handleUseBed looks the entity up by id, validates the bed block, sets the sleeping position and marks the entity as sleeping. EntityTrackerEntry broadcasts S0A to tracking players when a tracked entity enters a bed, and EntityPlayerMP sends it on its own connection in sleepInBedAt.

Why clients touch it

No module in the 8 clients hooks S0A. The only non-vanilla reference is Rise 6.x NetworkAPI, which lists S0A in the script API packet whitelist so JavaScript modules can register receive handlers for it; that is framework plumbing, not module logic. Bed mechanics are absent from the 1.8 PvP servers these clients target, and a sleep pose carries no combat, movement or render value, so nothing listens.

Exploit surface

None observed in the corpus. The packet is clientbound and informational: it changes only a render pose. The bed-position BlockPos is never validated by clients for gameplay effect, and no anti-cheat measures sleeping. The honest assessment is that S0A is protocol trivia in this ecosystem: it exists, it is registered in every client's EnumConnectionState, and nothing exploits it.

Server-Side Handling

EntityPlayerMP.sleepInBedAt constructs S0A with the player and bed location and sends it on the sleeper's own connection; EntityTrackerEntry re-broadcasts it to all tracking players. There is no server-side validation of the pose beyond the bed-block checks in the sleep routine itself.

Protocol Analysis

Fields: VarInt entity id, then BlockPos serialized as a long (x << 38 | z << 12 | y, with the y sign bit). Sent in PLAY state, clientbound. The leave-bed counterpart is S0BPacketAnimation type 2, so the two packets bracket a sleep cycle. Registered at id 0x0A in every client's EnumConnectionState.

Anti-Cheat Landscape

Nothing to flag: S0A changes only a pose and carries no timing, position or state information an anti-cheat could measure. The only ecosystem wrinkle is that a client which never renders the sleep pose (or renders it wrong) produces a visual mismatch, never a flag.

implementation Implementation Cases

The sleep-pose broadcast: entity id plus bed BlockPos, sent on join and re-broadcast by the entity tracker. Zero module hits across the 8 clients; the only non-vanilla reference is the Rise script API packet whitelist. Bed mechanics do not exist on the servers these clients target, so S0A is protocol trivia.

Rise 6.x scripts can register S0A receive handlers through NetworkAPI, but no shipped module does.
All 8 clients register S0A in vanilla code paths identically; only Rise 6.x adds the script API whitelist entry.

anticheat Anti-Cheat Checks

The use-bed packet has a single corpus hit: Artemis registers a GPacketPlayServerBed wrapper that decodes the player id and bed BlockPos. No check consumes it. The packet is a clientbound pose broadcast with no timing, position or state claim a server-side anticheat could measure, so the ecosystem ignores it.

Packet wrapper registration (Artemis) (artemisac-artemis-minecraft-anticheat)

Register the use-bed packet in Artemis's packet abstraction so the wrapper tree recognizes clientbound bed traffic.

GPacketPlayServerBed extends GPacket, links to PacketPlayServerBed, and its read() decodes the player id as a VarInt and the bed position as a packed BlockPos. No check in the corpus consumes these fields.

Detects: Nothing. The entry documents the only corpus touch point for S0A: wrapper plumbing, not detection logic.

Source: artemisac-artemis-minecraft-anticheat, ac.artemis.packet.spigot/src/main/java/cc/ghast/packet/wrapper/packet/play/server/GPacketPlayServerBed.java

Variations: No other anticheat references S0APacketUseBed or PacketPlayOutBed.

Wiki Cross-Reference

PLAY id 0x0A: VarInt player id plus bed BlockPos packed as a single long; broadcast via tracker on sleep.

Render-pose only; the matching wake-up arrives as S0B animation type 2, so the two packets bracket a sleep cycle.

MCP 1.8.9 S0APacketUseBed implements Packet dispatching to INetHandlerPlayClient.handleUseBed; wire serde is readPacketData/writePacketData via readBlockPos, readVarIntFromBuffer.

1.8.9 callers: EntityTrackerEntry.? sends new S0APacketUseBed (line 442) +1 more: https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/entity/EntityTrackerEntry.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.

Module Analyses Using S0APacketUseBed

Full source walkthroughs of the modules and anti-cheats that use this packet.