0x37 S37PacketStatistics

Updates statistic values (walk distance, damage dealt, items crafted, etc.).

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

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

playerstats
Complete 6/8

Fields

FieldTypeDescription
statisticsMap<Statistic, Integer>Statistic-to-value mapping

Wire Encoding

FieldTypeNotes
CountVarInt
Per-StatVarInt+VarIntStat ID + value

MCP References

MCPNetHandlerPlayClient.handleStatistics()

Handler Interface

HNDINetHandlerPlayClient

Vanilla Source

S37PacketStatistics.java72 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.play.server;
2
3
import com.google.common.collect.Maps;
4
import java.io.IOException;
5
import java.util.Map;
6
import java.util.Map.Entry;
7
import net.minecraft.network.Packet;
8
import net.minecraft.network.PacketBuffer;
9
import net.minecraft.network.play.INetHandlerPlayClient;
10
import net.minecraft.stats.StatBase;
11
import net.minecraft.stats.StatList;
12
13
public class S37PacketStatistics implements Packet<INetHandlerPlayClient>
14
{
15
    private Map<StatBase, Integer> field_148976_a;
16
17
    public S37PacketStatistics()
18
    {
19
    }
20
21
    public S37PacketStatistics(Map<StatBase, Integer> p_i45173_1_)
22
    {
23
        this.field_148976_a = p_i45173_1_;
24
    }
25
26
    /**
27
     * Passes this Packet on to the NetHandler for processing.
28
     */
29
    public void processPacket(INetHandlerPlayClient handler)
30
    {
31
        handler.handleStatistics(this);
32
    }
33
34
    /**
35
     * Reads the raw packet data from the data stream.
36
     */
37
    public void readPacketData(PacketBuffer buf) throws IOException
38
    {
39
        int i = buf.readVarIntFromBuffer();
40
        this.field_148976_a = Maps.<StatBase, Integer>newHashMap();
41
42
        for (int j = 0; j < i; ++j)
43
        {
44
            StatBase statbase = StatList.getOneShotStat(buf.readStringFromBuffer(32767));
45
            int k = buf.readVarIntFromBuffer();
46
47
            if (statbase != null)
48
            {
49
                this.field_148976_a.put(statbase, Integer.valueOf(k));
50
            }
51
        }
52
    }
53
54
    /**
55
     * Writes the raw packet data to the data stream.
56
     */
57
    public void writePacketData(PacketBuffer buf) throws IOException
58
    {
59
        buf.writeVarIntToBuffer(this.field_148976_a.size());
60
61
        for (Entry<StatBase, Integer> entry : this.field_148976_a.entrySet())
62
        {
63
            buf.writeString(((StatBase)entry.getKey()).statId);
64
            buf.writeVarIntToBuffer(((Integer)entry.getValue()).intValue());
65
        }
66
    }
67
68
    public Map<StatBase, Integer> func_148974_c()
69
    {
70
        return this.field_148976_a;
71
    }
72
}

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

Deep Dive

Role in the protocol

The stats and achievements channel. The server ships a map of StatBase to integer value on join and after each stat change, and the client folds it into its StatisticsFile and triggers the achievement toast for positive achievement values. The payload mixes plain counters with achievements, so a module cannot silence the toast without also discarding the counters unless it rewrites the map.

Vanilla handling

handleStatistics iterates the entry set and calls the stat file writer's readStat per entry, then triggers the toast sequence for achievements with a value greater than zero. Server side, StatisticsFile.sendStats dumps the full file on join and sendUpdate pushes a delta after each change, both via S37. It is the only path by which the client learns its own stats, which makes it the interception point for any stats-related module.

Why clients touch it

Exactly one real module in the corpus: Rise 5.99 NoAchievements cancels every S37 on receive, killing the toast at the cost of stale local counters. The other seven clients have zero module hits; their corpus entries are the vanilla handler, the StatisticsFile producers, the registry and the Rise 6.x script NetworkAPI registration. The metadata draft for a StatSpoof module has no corpus backing. The landscape is thin because stats are cosmetic: they grant no combat, movement or rendering advantage.

Exploit surface

The entire surface is the client-side cancel, and it is invisible: there is no serverbound stats packet, so the server never learns the client discarded the data. Anti-cheats ignore the packet entirely. The engineering subtlety is collateral: S37 bundles achievements with counters, so NoAchievements trades accurate local stats for a quiet toast; a surgical implementation would rewrite the map instead of cancelling the packet.

Server-Side Handling

StatisticsFile.sendStats (join, full dump) and sendUpdate (per-change delta) both push via playerNetServerHandler.sendPacket. There is no rate limit, no acknowledgment and no retry: the server pushes and forgets, and the client applies whatever arrives. On join the packet is part of the login burst alongside S38 and S39.

Protocol Analysis

Encoding: VarInt count, then per entry a VarInt stat id and a VarInt value. Stat ids resolve against the client's own StatList tables; unknown ids are skipped silently. A full join dump is dozens of entries but each is compact, so the packet rarely matters for bandwidth. The values are absolute rather than deltas even in sendUpdate: the map holds the new totals.

Anti-Cheat Landscape

Not measured by any anti-cheat: no serverbound counterpart exists, so nothing about client behavior can be inferred from this stream, and the client-side cancel produces zero server-visible signal. Modules face no detection risk from S37 handling, which is why the only module in the corpus uses it as a blunt UI toggle.

implementation Implementation Cases

The stats and achievements channel, normally invisible to cheat clients. Exactly one corpus module touches it: Rise 5.99 NoAchievements cancels the packet on receive to silence the achievement toast, accepting stale local counters as the price. Everything else in the corpus is vanilla handler and producer code.

NoAchievements (Rise 5.99)

Suppress the achievement notification toast by cancelling the entire statistics packet.

A PacketReceiveEvent handler checks the packet type and calls event.setCancelled(true) on every S37PacketStatistics. Because the packet bundles plain stat counters with achievements, cancelling it also kills the toast trigger inside handleStatistics; the local counters simply never update.

Source: Rise 5.99, dev/rise/module/impl/render/NoAchievements.java

Vanilla hook: PacketReceiveEvent.
Zero detection risk: the cancel is client-only and the packet has no serverbound counterpart, so the server sees no signal at all. The only cost is stale local statistics and achievement state.
Variations: Single implementation in the corpus. Rise 6.x ships no NoAchievements module; it registers S37 for its script API instead.
PacketReceiveEvent on the client event bus; only Rise 5.99 registers one for S37.
Rise 5.99 cancels the live packet via event.setCancelled(true); Rise 6.x has no module but whitelists the class in the script NetworkAPI.

anticheat Anti-Cheat Checks

No anti-cheat reads the statistics packet. The corpus hits all match the Statistic or Statistics keyword, not the packet: Photon's DoubleStatistics and batch-processing math, TruthfulAC's Statistics utilities, Artemis' DescriptiveStatistics in the autoclicker checks, intave's CheckStatistics bookkeeping, Kauri's Interval summary statistics, Hydro's violation-message Statistics line, Shard's Bukkit Statistic enum reads in ProfileCommand, MC-Jinky's statistics key message and NCP's comment noise are all statistical infrastructure. The only direct packet references are registrations: Negativity's STATISTIC constant, FlopAC's NMSObject STATISTICS string, and Artemis' PacketRepository entry with the PacketPlayServerStatistic wrapper. S37 is pure server-authored display state with no serverbound counterpart, so nothing about client behavior can be inferred from it.

Wiki Cross-Reference

The client can explicitly request its statistics through the Client Status packet, which the server answers with this packet.

The statistic map covers block-mining, item crafting, use, breakage, pickup, and drop counters, entity kills and deaths-by-entity, plus custom counters such as play time, distances traveled, damage dealt and taken, deaths, mob kills, and player kills.

MCP 1.8.9 S37PacketStatistics implements Packet dispatching to INetHandlerPlayClient.handleStatistics; wire serde is readPacketData/writePacketData via readStringFromBuffer, readVarIntFromBuffer.

1.8.9 callers: StatisticsFile.func_150876_a sends new S37PacketStatistics (line 227): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/stats/StatisticsFile.java

Cross-checked against minecraft.wiki (CC BY-SA 3.0) for 1.8.9 accuracy.