0x39 S39PacketPlayerAbilities

Server updates the player's capabilities (flying, invulnerable, creative, fly speed, walk speed).

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

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

playerabilitiesflight
Comprehensive 8/8

Fields

FieldTypeDescription
flagsbyte bitmask0x01=invulnerable, 0x02=flying, 0x04=allowFlying, 0x08=creative
flySpeedfloatFlight speed (default 0.05)
walkSpeedfloatWalk speed (default 0.1)

Wire Encoding

FieldTypeNotes
FlagsbyteBitmask
Fly Speedfloat0.05 default
Walk Speedfloat0.1 default

MCP References

MCPNetHandlerPlayClient.handlePlayerAbilities()

Handler Interface

HNDINetHandlerPlayClient

Notes

This is the SERVER→CLIENT version. The server sends this when the player's abilities change. The CLIENT→SERVER version is C13PacketPlayerAbilities (which only carries the isFlying flag).

Vanilla Source

S39PacketPlayerAbilities.java145 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.entity.player.PlayerCapabilities;
5
import net.minecraft.network.Packet;
6
import net.minecraft.network.PacketBuffer;
7
import net.minecraft.network.play.INetHandlerPlayClient;
8
9
public class S39PacketPlayerAbilities implements Packet<INetHandlerPlayClient>
10
{
11
    private boolean invulnerable;
12
    private boolean flying;
13
    private boolean allowFlying;
14
    private boolean creativeMode;
15
    private float flySpeed;
16
    private float walkSpeed;
17
18
    public S39PacketPlayerAbilities()
19
    {
20
    }
21
22
    public S39PacketPlayerAbilities(PlayerCapabilities capabilities)
23
    {
24
        this.setInvulnerable(capabilities.disableDamage);
25
        this.setFlying(capabilities.isFlying);
26
        this.setAllowFlying(capabilities.allowFlying);
27
        this.setCreativeMode(capabilities.isCreativeMode);
28
        this.setFlySpeed(capabilities.getFlySpeed());
29
        this.setWalkSpeed(capabilities.getWalkSpeed());
30
    }
31
32
    /**
33
     * Reads the raw packet data from the data stream.
34
     */
35
    public void readPacketData(PacketBuffer buf) throws IOException
36
    {
37
        byte b0 = buf.readByte();
38
        this.setInvulnerable((b0 & 1) > 0);
39
        this.setFlying((b0 & 2) > 0);
40
        this.setAllowFlying((b0 & 4) > 0);
41
        this.setCreativeMode((b0 & 8) > 0);
42
        this.setFlySpeed(buf.readFloat());
43
        this.setWalkSpeed(buf.readFloat());
44
    }
45
46
    /**
47
     * Writes the raw packet data to the data stream.
48
     */
49
    public void writePacketData(PacketBuffer buf) throws IOException
50
    {
51
        byte b0 = 0;
52
53
        if (this.isInvulnerable())
54
        {
55
            b0 = (byte)(b0 | 1);
56
        }
57
58
        if (this.isFlying())
59
        {
60
            b0 = (byte)(b0 | 2);
61
        }
62
63
        if (this.isAllowFlying())
64
        {
65
            b0 = (byte)(b0 | 4);
66
        }
67
68
        if (this.isCreativeMode())
69
        {
70
            b0 = (byte)(b0 | 8);
71
        }
72
73
        buf.writeByte(b0);
74
        buf.writeFloat(this.flySpeed);
75
        buf.writeFloat(this.walkSpeed);
76
    }
77
78
    /**
79
     * Passes this Packet on to the NetHandler for processing.
80
     */
81
    public void processPacket(INetHandlerPlayClient handler)
82
    {
83
        handler.handlePlayerAbilities(this);
84
    }
85
86
    public boolean isInvulnerable()
87
    {
88
        return this.invulnerable;
89
    }
90
91
    public void setInvulnerable(boolean isInvulnerable)
92
    {
93
        this.invulnerable = isInvulnerable;
94
    }
95
96
    public boolean isFlying()
97
    {
98
        return this.flying;
99
    }
100
101
    public void setFlying(boolean isFlying)
102
    {
103
        this.flying = isFlying;
104
    }
105
106
    public boolean isAllowFlying()
107
    {
108
        return this.allowFlying;
109
    }
110
111
    public void setAllowFlying(boolean isAllowFlying)
112
    {
113
        this.allowFlying = isAllowFlying;
114
    }
115
116
    public boolean isCreativeMode()
117
    {
118
        return this.creativeMode;
119
    }
120
121
    public void setCreativeMode(boolean isCreativeMode)
122
    {
123
        this.creativeMode = isCreativeMode;
124
    }
125
126
    public float getFlySpeed()
127
    {
128
        return this.flySpeed;
129
    }
130
131
    public void setFlySpeed(float flySpeedIn)
132
    {
133
        this.flySpeed = flySpeedIn;
134
    }
135
136
    public float getWalkSpeed()
137
    {
138
        return this.walkSpeed;
139
    }
140
141
    public void setWalkSpeed(float walkSpeedIn)
142
    {
143
        this.walkSpeed = walkSpeedIn;
144
    }
145
}

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

Deep Dive

Role in the protocol

Server-to-client capability sync: one flags byte (0x01 invulnerable, 0x02 flying, 0x04 allowFlying, 0x08 creative), then fly speed and walk speed floats. The server pushes it on join, on every capabilities change, and as part of the login burst alongside S01, S37 and S38. Its serverbound mirror C13PacketPlayerAbilities carries only the isFlying flag, so S39 is the only place the client learns the full authoritative set.

Vanilla handling

handlePlayerAbilities copies all four flags and both speeds into thePlayer.capabilities, and the movement code then obeys them: fly speed scales creative flight, walk speed scales ground speed. Server side, processPlayerAbilities (C13) flips only isFlying and only when allowFlying is true, so the server stays authoritative and re-broadcasts the corrected state via S39 whenever it disagrees with the client. The client handlers are behaviorally identical across all 8 corpus clients.

Why clients touch it

Three Rise 6.x surface areas. CreativeFlight, a mode of the Flight module, rewrites the received packet in place: wrapper.setFlying(mc.thePlayer.capabilities.isFlying) so the server's flying flag can never desync the client while the mode force-flies the player at timer speed 3. Debugger carries an Abilities toggle that prints fly speed, allowFlying and isFlying to chat for protocol inspection. PingSpoofComponent classifies S39 as a teleport-class packet, so when a spoof window is active, held S39 packets flush together with S08 teleports and S09 held-item changes rather than being held with regular traffic.

Exploit surface

The packet is clientbound, so the server cannot see mutations; the risk is desync rather than detection. CreativeFlight's rewrite makes local capabilities authoritative and hides the server's corrections, viable only while the server does not re-send S39 faster than the module rewrites it. The packet also constrains packet-holding systems: because S39 arrives on gamemode and flight changes, holding it across an S08 teleport would leave the client's flag state and position inconsistent, which is why the component groups the three packet classes.

Server-Side Handling

EntityPlayerMP re-sends S39 whenever the capabilities setter path detects a change, and ServerConfigurationManager sends it once on join. C13 processing is the only serverbound input and it gates flying on allowFlying; the server's S39 responses are the corrective loop that keeps the client honest about permission.

Protocol Analysis

One flags byte then two raw 32-bit IEEE floats with no quantization: 0.05 default fly speed, 0.1 default walk speed. Bit 0x02 is current flying, 0x04 is permission to fly; creative players get both set, survival players neither unless a plugin grants flight. The same byte layout is reused by C13, which zeroes the unused fields.

Anti-Cheat Landscape

Anti-cheats infer flight from movement and C13, not from S39, but the packet is a synchronization oracle for them: a client that never confirms flying while the S39 stream says flying is on is not mirroring state, and the movement that follows is what actually flags. CreativeFlight's rewrite exists to keep that mirror consistent. Holding components treat S39 as teleport-adjacent because a held S39 crossing a held S08 desyncs flags and position, a failure mode that correlates with timer and fly flags.

implementation Implementation Cases

The authoritative capability sync packet: flags byte plus fly and walk speeds, mirrored by a single-flag serverbound C13. Three Rise 6.x surface areas in the corpus: CreativeFlight rewrites the received S39 to claim flying, Debugger prints its fields for protocol inspection, and PingSpoofComponent treats it as teleport-class traffic so held S39 flushes with S08.

CreativeFlight (Rise 6.2.4, Rise 6.1.30)

Force creative-style flight on survival servers by keeping the server's flying flag in sync with client-forced capabilities.

A mode of the Flight module. On enable it sets capabilities.isFlying and jumps; on pre-motion it force-flies with timer speed 3 and motion scaling. In the receive handler, every S39PacketPlayerAbilities is rewritten in place: wrapper.setFlying(mc.thePlayer.capabilities.isFlying), so the server's corrections can never desync the local flying state. PreUpdateEvent arms PingSpoofComponent.spoof(300000, ...) to hold all stateful traffic while the mode runs.

Source: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/movement/flight/CreativeFlight.java

Vanilla hook: PacketReceiveEvent (mutation), PreUpdateEvent (spoof arming), PreMotionEvent (movement).
The mutation is invisible to the server, but the movement it enables (timer 3, 9.5x motion scaling) is a textbook fly flag on any serious anti-cheat; the S39 rewrite only prevents the flag-state desync that would compound the detection.
Variations: Rise 6.1.30 carries the same mode with an identical S39 branch (wrapper.setFlying(mc.thePlayer.capabilities.isFlying)); the 6.2.4 build adds the Render3D interpolation scaffolding.
Debugger (Rise 6.2.4, Rise 6.1.30)

Developer tool that prints protocol traffic to chat, including a dedicated Abilities readout for S39.

The receive handler branches by packet class: S32 transactions, S00 keepalives, S08 teleports, S12 velocity, S27 explosions and S39 abilities each print their fields. The S39 branch logs fly speed, allowFlying and isFlying via the MCP accessors. The send side only fires while Client.DEVELOPMENT_SWITCH is set, but the receive side is live in release builds.

Source: Rise 6.1.30, com/alan/clients/module/impl/other/Debugger.java

Vanilla hook: PacketReceiveEvent; PacketSendEvent gated on the development switch.
None; the module only reads packets and prints text. It is a diagnostic tool, included here because it is the only corpus code that consumes S39 purely for inspection.
Variations: Rise 6.2.4 ships the same module under Client-release2/Client/src/main/java with an identical S39 branch.
PingSpoofComponent (packet holding) (Rise 6.2.4, Rise 6.1.30)

Hold and replay latency-sensitive packets; S39 is classified as teleport-class so it flushes together with S08 rather than with regular traffic.

The component owns five class tuples (regular, velocity, teleports, players, blink, movement) plus per-tuple enable flags set by spoof(). While enabled, matching packets are cancelled on send or receive and queued as TimedPacket entries; on PostMotion, entries older than the spoof amount are replayed via PacketUtil.queue. S39PacketPlayerAbilities sits in the teleports tuple with S08PacketPlayerPosLook and S09PacketHeldItemChange.

Source: Rise 6.1.30, com/alan/clients/component/impl/player/PingSpoofComponent.java

Vanilla hook: PacketReceiveEvent, PacketSendEvent, PostMotionEvent, WorldChangeEvent.
Holding S39 is not itself detectable, but the desync it prevents is: a held S39 crossing a held S08 would leave flag state and position inconsistent, a correlation anti-cheats can use. The teleport grouping exists to keep that ordering intact.
Variations: Rise 6.2.4 ships the identical component under Client-release2/Client/src/main/java; both versions are driven by the same spoof() and blink() entry points.
PacketReceiveEvent is the common surface; CreativeFlight mutates the packet object on the event, Debugger reads it, PingSpoofComponent cancels and queues it.
Rise 6.x uses the component system for holding; the 6.1.30 and 6.2.4 trees are functionally identical. The other six clients carry only the vanilla handler and have no S39 modules.

anticheat Anti-Cheat Checks

The abilities packet is the server's flight permission broadcast: it carries allow-flight, invulnerable, creative, and the fly and walk speed factors, and it is the synchronization oracle anticheats use to validate the client's own abilities packet (C13). Checks pair the two directions: the server send sets the player's canFly and isFlying state, and the client send is checked against that state, so a flying flag without a server grant is a spoof. Grim runs a dedicated both-direction check plus a fly-flag spoof check; older anticheats fold the client abilities packet into their packet dispatch to feed movement physics.

Abilities state sync (Grim) (GrimAnticheat-Grim)

Keep the player's flight capability and flying flag in sync with what the server last sent on S39, so every other movement check reasons about the same flight state the client was granted.

PacketPlayerAbilities listens on both directions. On the client abilities packet (C13) it sets player.isFlying to the packet's flying flag gated on player.canFly. On the server send (S39) it opens a transaction, remembers the last sent allow-flight value, and if flight was just revoked schedules a netty task that fires a setback when the client's transaction has not confirmed receipt within max-ping-out-of-flying (default 1000ms). A real-time task then applies canFly and isFlying from the server packet. The comment in the source explains the ordering hazard: Mojang's netcode lets ability packets arrive out of order, so state is applied one tick late to stop a client from flying for a tick before the anticheat knows.

Detects: Clients that fly while the server has not granted flight, and clients that keep flying after the server revokes the ability. This is the S39-side half of fly-cheat detection.

Source: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/events/packets/PacketPlayerAbilities.java

Variations: Artemis mirrors the server abilities packet into its emulated entity capabilities in EmulatorPreProcessor (GPacketPlayServerAbilities), and BetterAnticheat's PlayerCapabilities reads WrapperPlayServerPlayerAbilities into isFlying, canFly and flySpeed fields; both are the same S39-as-oracle pattern.
Fly flag spoof (Grim BadPacketsI) (GrimAnticheat-Grim)

Flag a client abilities packet that claims flying while the server has never granted flight on S39.

A PreVia packet receive listener: when the packet type is PLAYER_ABILITIES, the wrapper reports isFlying true, and player.canFly is false, the check flags and cancels the packet. canFly is only ever true after the server sent allow-flight on S39, so this is a direct cross-check of the client's C13 claim against the S39 grant.

Detects: Spoofed flying flags, creative-fly hacks that send the flying bit without permission, and clients that desync their abilities state from the server.

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

Variations: AutoEye reads the same client packet in its netty channel handler and pushes the flying bit into the movement physics, so its fly checks run with the client's claimed flight state; Observer's Move check tracks a creativeFly boolean from C13PacketPlayerAbilities and exempts movement while it is set.
Abilities dispatch (AutoEye) (heirteir-AutoEye)

Route the client abilities packet into the movement physics state so fly and timer checks see the client's claimed flight mode.

The channel handler switch matches PacketPlayInAbilities and writes the wrapper's flying bit into the player's physics state via setFlying. It is the C13-side counterpart to the S39 grant: AutoEye has no server-side abilities reader, so it trusts the client bit and lets the movement checks decide whether the resulting motion is possible.

Detects: Fly cheats that move with the flying flag set. The state feeds the movement check pipeline rather than flagging directly.

Source: heirteir-AutoEye, src/main/java/com/heirteir/autoeye/packets/channelhandler/ChannelHandlerAbstract.java

Variations: The dispatch pattern is shared by the 1.8 anticheat generation: the abilities packet is folded into per-player state, and flight permission is either trusted from the client or not tracked at all. Grim is the outlier that validates the claim against the server send.

Wiki Cross-Reference

If the Flying flag is set while Allow Flying is unset, the player cannot stop flying, so the two bits must stay consistent.

The third float doubles as a field-of-view modifier tied to movement speed, which is why the vanilla server sends the same 0.1 default as the movement-speed attribute.

MCP 1.8.9 S39PacketPlayerAbilities implements Packet dispatching to INetHandlerPlayClient.handlePlayerAbilities; wire serde is readPacketData/writePacketData via readByte, readFloat.

1.8.9 callers: EntityPlayerMP.sendPlayerAbilities sends new S39PacketPlayerAbilities (line 1092) +1 more: https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/entity/player/EntityPlayerMP.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 S39PacketPlayerAbilities

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