0x05 S05PacketSpawnPosition

Sets the player's spawn position (where compass points and respawn occurs).

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

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

playerworldspawn
Complete 6/8

Fields

FieldTypeDescription
spawnPosBlockPosSpawn block position

Wire Encoding

FieldTypeNotes
Spawn PositionBlockPos (long)

MCP References

MCPNetHandlerPlayClient.handleSpawnPosition()

Handler Interface

HNDINetHandlerPlayClient

Vanilla Source

S05PacketSpawnPosition.java50 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.network.Packet;
5
import net.minecraft.network.PacketBuffer;
6
import net.minecraft.network.play.INetHandlerPlayClient;
7
import net.minecraft.util.BlockPos;
8
9
public class S05PacketSpawnPosition implements Packet<INetHandlerPlayClient>
10
{
11
    private BlockPos spawnBlockPos;
12
13
    public S05PacketSpawnPosition()
14
    {
15
    }
16
17
    public S05PacketSpawnPosition(BlockPos spawnBlockPosIn)
18
    {
19
        this.spawnBlockPos = spawnBlockPosIn;
20
    }
21
22
    /**
23
     * Reads the raw packet data from the data stream.
24
     */
25
    public void readPacketData(PacketBuffer buf) throws IOException
26
    {
27
        this.spawnBlockPos = buf.readBlockPos();
28
    }
29
30
    /**
31
     * Writes the raw packet data to the data stream.
32
     */
33
    public void writePacketData(PacketBuffer buf) throws IOException
34
    {
35
        buf.writeBlockPos(this.spawnBlockPos);
36
    }
37
38
    /**
39
     * Passes this Packet on to the NetHandler for processing.
40
     */
41
    public void processPacket(INetHandlerPlayClient handler)
42
    {
43
        handler.handleSpawnPosition(this);
44
    }
45
46
    public BlockPos getSpawnPos()
47
    {
48
        return this.spawnBlockPos;
49
    }
50
}

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

Deep Dive

Role in the protocol

Carries the world spawn as a packed BlockPos. ServerConfigurationManager sends it on player join (lines ~164 and ~476 in the bundled sources) and CommandSetDefaultSpawnpoint broadcasts it to all players when /setworldspawn runs (line ~45). The value drives the compass needle, the debug-screen spawn readout and the fallback respawn point; it is world metadata, not player state.

Vanilla handling

handleSpawnPosition runs on the main thread and performs two writes: thePlayer.setSpawnPoint(pos, true) (func_180473_a in MCP) for the personal bed spawn, and world.getWorldInfo().setSpawn(pos) for the world spawn. The packet never moves the player and touches no entity state, which is why nothing in the client reacts to it beyond the two field writes.

Why clients never touch it

Zero module hits across all 8 clients; the only non-vanilla references are the Rise 6.x script whitelist entries (NetworkAPI.java line 51). Compass and waypoint features read mc.theWorld.getSpawnPoint() on render because the vanilla handler has already committed the value before any event bus runs, so intercepting S05 would only let a module lie to itself. There is no state transition in the packet for a module to key off.

Exploit surface

None. A client-side mutation alters only the local compass and respawn UI, and the server re-sends the authoritative spawn on every join and respawn, so the change does not persist and cannot affect gameplay. No anti-cheat measures the packet.

Server-Side Handling

ServerConfigurationManager sends S05PacketSpawnPosition on player join (line ~164 for the join sequence and line ~476 on respawn), and CommandSetDefaultSpawnpoint broadcasts it to all players when the spawn point changes. The BlockPos is packed as a single long on the wire. The server holds the authoritative copy and re-sends it at every world boundary, so a client-side alteration is always corrected within one join or respawn.

Protocol Analysis

Single BlockPos field encoded as one long (x << 38 | z << 12 | y in the 1.8 packing). Sent in the PLAY state, usually immediately after S01PacketJoinGame and before or alongside the initial chunk stream. Because the value feeds both the world info and the player's personal spawn, receiving it twice (join plus respawn) is normal and idempotent.

Anti-Cheat Landscape

Nothing to flag: the packet carries no timing, position or input signal, and the client cannot send a serverbound equivalent. Its only downstream effect, the compass direction, has no anti-cheat relevance.

implementation Implementation Cases

A one-field world-metadata write (BlockPos spawn) that the vanilla handler commits before any module event runs. Zero module hits in the 8-client corpus, so the module list is empty; compass and waypoint features read the committed value directly and have no reason to intercept the packet.

All 8 clients ship the vanilla handler unchanged; Rise 6.x additionally whitelists the packet for the script API. Rise 5.99 has no corpus entry for this packet at all.

anticheat Anti-Cheat Checks

S05 is a one-field world-metadata write (the spawn BlockPos) with no serverbound counterpart and no timing, position or input signal, so no anticheat consumes it. The corpus is two registrations: Negativity's PacketType SPAWN_POSITION constant and Artemis PacketRepository's SERVER_PLAY + 71 mapping to PacketPlayServerSpawnPosition, plus the Artemis packet interface itself. checks: [] reflects the corpus: nothing in any of the 50 anticheats reads the spawn position from this packet, and its only downstream effect (the compass) has no anti-cheat relevance.

Wiki Cross-Reference

Before receiving this packet the client uses the default spawn of 8, 64, 8, and the packet also updates what compasses point to.

It can be sent at any time to update the compass target, not only at login.

MCP 1.8.9 S05PacketSpawnPosition implements Packet dispatching to INetHandlerPlayClient.handleSpawnPosition; wire serde is readPacketData/writePacketData via readBlockPos.

1.8.9 callers: CommandSetDefaultSpawnpoint.processCommand sends new S05PacketSpawnPosition (line 60) +1 more: https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.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.