0x44 S44PacketWorldBorder

Updates the world border (center, size, warning distance/buffer, damping).

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

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

worldborder
Complete 6/8

Fields

FieldTypeDescription
actionVarInt Enum0=setSize, 1=lerpSize, 2=setCenter, 3=initialize, 4=setWarningTime, 5=setWarningBlocks
fieldsvariesAction-dependent border parameters

Wire Encoding

FieldTypeNotes
ActionVarInt0=size, 1=lerp, 2=center, 3=init, 4=warnTime, 5=warnBlocks
Per-Action Datavaries

MCP References

MCPNetHandlerPlayClient.handleWorldBorder()

Handler Interface

HNDINetHandlerPlayClient

Vanilla Source

S44PacketWorldBorder.java185 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.world.border.WorldBorder;
8
9
public class S44PacketWorldBorder implements Packet<INetHandlerPlayClient>
10
{
11
    private S44PacketWorldBorder.Action action;
12
    private int size;
13
    private double centerX;
14
    private double centerZ;
15
    private double targetSize;
16
    private double diameter;
17
    private long timeUntilTarget;
18
    private int warningTime;
19
    private int warningDistance;
20
21
    public S44PacketWorldBorder()
22
    {
23
    }
24
25
    public S44PacketWorldBorder(WorldBorder border, S44PacketWorldBorder.Action actionIn)
26
    {
27
        this.action = actionIn;
28
        this.centerX = border.getCenterX();
29
        this.centerZ = border.getCenterZ();
30
        this.diameter = border.getDiameter();
31
        this.targetSize = border.getTargetSize();
32
        this.timeUntilTarget = border.getTimeUntilTarget();
33
        this.size = border.getSize();
34
        this.warningDistance = border.getWarningDistance();
35
        this.warningTime = border.getWarningTime();
36
    }
37
38
    /**
39
     * Reads the raw packet data from the data stream.
40
     */
41
    public void readPacketData(PacketBuffer buf) throws IOException
42
    {
43
        this.action = (S44PacketWorldBorder.Action)buf.readEnumValue(S44PacketWorldBorder.Action.class);
44
45
        switch (this.action)
46
        {
47
            case SET_SIZE:
48
                this.targetSize = buf.readDouble();
49
                break;
50
51
            case LERP_SIZE:
52
                this.diameter = buf.readDouble();
53
                this.targetSize = buf.readDouble();
54
                this.timeUntilTarget = buf.readVarLong();
55
                break;
56
57
            case SET_CENTER:
58
                this.centerX = buf.readDouble();
59
                this.centerZ = buf.readDouble();
60
                break;
61
62
            case SET_WARNING_BLOCKS:
63
                this.warningDistance = buf.readVarIntFromBuffer();
64
                break;
65
66
            case SET_WARNING_TIME:
67
                this.warningTime = buf.readVarIntFromBuffer();
68
                break;
69
70
            case INITIALIZE:
71
                this.centerX = buf.readDouble();
72
                this.centerZ = buf.readDouble();
73
                this.diameter = buf.readDouble();
74
                this.targetSize = buf.readDouble();
75
                this.timeUntilTarget = buf.readVarLong();
76
                this.size = buf.readVarIntFromBuffer();
77
                this.warningDistance = buf.readVarIntFromBuffer();
78
                this.warningTime = buf.readVarIntFromBuffer();
79
        }
80
    }
81
82
    /**
83
     * Writes the raw packet data to the data stream.
84
     */
85
    public void writePacketData(PacketBuffer buf) throws IOException
86
    {
87
        buf.writeEnumValue(this.action);
88
89
        switch (this.action)
90
        {
91
            case SET_SIZE:
92
                buf.writeDouble(this.targetSize);
93
                break;
94
95
            case LERP_SIZE:
96
                buf.writeDouble(this.diameter);
97
                buf.writeDouble(this.targetSize);
98
                buf.writeVarLong(this.timeUntilTarget);
99
                break;
100
101
            case SET_CENTER:
102
                buf.writeDouble(this.centerX);
103
                buf.writeDouble(this.centerZ);
104
                break;
105
106
            case SET_WARNING_BLOCKS:
107
                buf.writeVarIntToBuffer(this.warningDistance);
108
                break;
109
110
            case SET_WARNING_TIME:
111
                buf.writeVarIntToBuffer(this.warningTime);
112
                break;
113
114
            case INITIALIZE:
115
                buf.writeDouble(this.centerX);
116
                buf.writeDouble(this.centerZ);
117
                buf.writeDouble(this.diameter);
118
                buf.writeDouble(this.targetSize);
119
                buf.writeVarLong(this.timeUntilTarget);
120
                buf.writeVarIntToBuffer(this.size);
121
                buf.writeVarIntToBuffer(this.warningDistance);
122
                buf.writeVarIntToBuffer(this.warningTime);
123
        }
124
    }
125
126
    /**
127
     * Passes this Packet on to the NetHandler for processing.
128
     */
129
    public void processPacket(INetHandlerPlayClient handler)
130
    {
131
        handler.handleWorldBorder(this);
132
    }
133
134
    public void func_179788_a(WorldBorder border)
135
    {
136
        switch (this.action)
137
        {
138
            case SET_SIZE:
139
                border.setTransition(this.targetSize);
140
                break;
141
142
            case LERP_SIZE:
143
                border.setTransition(this.diameter, this.targetSize, this.timeUntilTarget);
144
                break;
145
146
            case SET_CENTER:
147
                border.setCenter(this.centerX, this.centerZ);
148
                break;
149
150
            case SET_WARNING_BLOCKS:
151
                border.setWarningDistance(this.warningDistance);
152
                break;
153
154
            case SET_WARNING_TIME:
155
                border.setWarningTime(this.warningTime);
156
                break;
157
158
            case INITIALIZE:
159
                border.setCenter(this.centerX, this.centerZ);
160
161
                if (this.timeUntilTarget > 0L)
162
                {
163
                    border.setTransition(this.diameter, this.targetSize, this.timeUntilTarget);
164
                }
165
                else
166
                {
167
                    border.setTransition(this.targetSize);
168
                }
169
170
                border.setSize(this.size);
171
                border.setWarningDistance(this.warningDistance);
172
                border.setWarningTime(this.warningTime);
173
        }
174
    }
175
176
    public static enum Action
177
    {
178
        SET_SIZE,
179
        LERP_SIZE,
180
        SET_CENTER,
181
        INITIALIZE,
182
        SET_WARNING_TIME,
183
        SET_WARNING_BLOCKS;
184
    }
185
}

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

Deep Dive

Role in the protocol

World border state machine with six actions: SET_SIZE, LERP_SIZE, SET_CENTER, INITIALIZE, SET_WARNING_TIME and SET_WARNING_BLOCKS. ServerConfigurationManager broadcasts the five change actions to all players on border mutation (lines 245-261 in the MCP builds) and sends INITIALIZE to each player on join (line 786). INITIALIZE is the only action carrying the full state: center, current and target diameter, transition time, and both warning values.

Vanilla handling

The client handler func_175093_a delegates to packet.func_179788_a(worldBorder), which mutates the single WorldBorder object owned by the client world: setCenter, setTransition, setWarningDistance and setWarningTime. The border then feeds the renderer's red vignette and the camera clamp in EntityRenderer. It is one of the few packets whose handler mutates shared world state instead of copying values into local fields.

Why clients touch it

No module in the 8 clients references S44. Border tracking would matter for movement modules pathing around a shrinking border or for border-bypass claims, but none exists in the corpus. The border is server-enforced: EntityPlayerMP movement validation and WorldBorder.intersects run server-side and teleport or damage players who cross it, so the client's copy is purely cosmetic and modules gain nothing by intercepting it.

Exploit surface

All six actions deserialize doubles and a VarLong transition time with no sanity bounds; a hostile server can inject NaN or extreme diameters into the client WorldBorder, which the renderer then lerps against, producing visual glitches (the classic NaN border). Because enforcement is server-side, corrupting the client border changes nothing gameplay-relevant. The notable quirk is LERP_SIZE's VarLong time field, which is milliseconds server-side, not ticks.

Server-Side Handling

ServerConfigurationManager registers a WorldBorder listener that broadcasts SET_SIZE, LERP_SIZE, SET_CENTER, SET_WARNING_TIME and SET_WARNING_BLOCKS to all players on mutation (lines 245-261, MCP numbering), and sends INITIALIZE in initializeConnectionToPlayer (line 786). INITIALIZE serializes the whole border: center X/Z doubles, diameter and target doubles, VarLong transition time, warning distance and warning time ints.

Protocol Analysis

Action is a VarInt enum; payload depends on action. SET_SIZE: one double (target diameter). LERP_SIZE: old diameter double, target double, VarLong transition time in milliseconds. SET_CENTER: two doubles. SET_WARNING_TIME and SET_WARNING_BLOCKS: one int each. INITIALIZE: center doubles, both diameters, VarLong, and both warning ints. readEnumValue can return null on an out-of-range action, which NPEs in the read switch.

Anti-Cheat Landscape

No anti-cheat measures border packets. The server enforces the border in its own movement pipeline (EntityPlayerMP position validation against WorldBorder.intersects), so client-side border state has no bearing on any server-side check. The only client-visible effect of tampering is rendering artifacts.

implementation Implementation Cases

Six-action world border state machine, broadcast on change and fully initialized on join. Server-enforced, so the client copy is cosmetic; none of the 8 clients has a module that references it. The interesting wire details are the mixed field widths and the VarLong transition time.

anticheat Anti-Cheat Checks

The world border packet is the one clientbound world-state packet anticheats genuinely consume. Grim decodes all five actions into a border state and feeds it into the collision pipeline so phase checks treat the border as a solid wall, and intave decodes the same actions into the border model its movement simulation runs against. NCP and Artemis implement the border-as-wall idea too, but they read Bukkit's server-side WorldBorder instead of the packet. Negativity and Artemis also register the packet type.

PacketWorldBorder (Grim) (GrimAnticheat-Grim)

Mirror the server's world border state on the compensation side so collision and movement checks know where the border is.

A PacketSendListener that wraps the five border packet forms (WORLD_BORDER action packet, INITIALIZE_WORLD_BORDER, WORLD_BORDER_CENTER, WORLD_BORDER_SIZE, WORLD_BORDER_LERP_SIZE) and mutates a BorderExtent: SET_SIZE and WORLD_BORDER_SIZE set the diameter, LERP_SIZE and WORLD_BORDER_LERP_SIZE build a moving extent with the transition duration, SET_CENTER and WORLD_BORDER_CENTER move the center, and INITIALIZE fills the whole state plus the portal teleport boundary. Each update is transaction-bracketed and applied on the next real-time task, and tickBorder() advances the lerp on movement ticks.

Detects: Nothing directly. It is the data foundation for the border collision check.

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

Variations: intave WorldBorderReader performs the same decode on intave's event bus; Artemis PacketRepository (SERVER_PLAY + 91) and Negativity PacketType only register the type.
Border collision (Grim Collisions) (GrimAnticheat-Grim, Updated-NoCheatPlus-NoCheatPlus, artemisac-artemis-minecraft-anticheat)

Treat the world border as an axis-aligned collision wall so phase and clipping checks cannot move a player through it.

Collisions.addWorldBorder computes the border's min and max X/Z from the PacketWorldBorder check state and, when the player is within 16 blocks of the border, appends four thin collision boxes (one per side, infinite in Y) to the box list the collision resolver tests against. getCollisionBoxes calls it first, so any movement that would place the player across the border collides like a wall.

Detects: Phase and border-bypass cheats that move through or beyond the world border.

Source: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/utils/nmsutil/Collisions.java

Variations: NCP CollisionUtil.addWorldBorder (line 1074) and Artemis NMS_v1_8 (lines 139-206) add the same border-as-wall boxes to their collision resolvers, but both read Bukkit's server-side WorldBorder and never parse the S44 packet.
WorldBorderReader (intave) (intave-intave)

Decode the border packet family into the immutable border model that intave's movement simulation runs against.

A packet reader registered for all seven border packet ids (WORLD_BORDER, SET_BORDER_CENTER, SET_BORDER_SIZE, SET_BORDER_LERP_SIZE, SET_BORDER_WARNING_DELAY, SET_BORDER_WARNING_DISTANCE, INITIALIZE_BORDER). updated() maps the packet type to an UpdateType, reads the doubles and longs out of the ProtocolLib container (with legacy 1.8 offset handling for the action packet), and returns a new WorldBorder: center updates rebuild with a new center, size updates set the diameter, lerp updates build a MovingWorldBorder with the transition time, and INITIALIZE applies all four. MovementDispatcher.sentWorldBorderUpdate (lines 803-812) feeds the result into the movement metadata, and the simulation environment exposes it through border().

Detects: Nothing directly. It keeps the simulation's boundary in sync so movement checks simulate against the correct border.

Source: intave-intave, src/main/java/de/jpx3/intave/packet/reader/WorldBorderReader.java

Variations: The decoded model is split into StaticWorldBorder and MovingWorldBorder under de.jpx3.intave.world.border; the simulation environment views (ImmutableSimulationEnvironmentCopy, MutableSimulationEnvironmentView, MockSimulationEnvironment) each carry a WorldBorder field with border() accessors.

Wiki Cross-Reference

Warning time is measured in seconds and warning distance in blocks, matching the units of the worldborder warning time and warning distance commands.

MCP 1.8.9 S44PacketWorldBorder implements Packet dispatching to INetHandlerPlayClient.handleWorldBorder; wire serde is readPacketData/writePacketData via readDouble, readEnumValue, readVarIntFromBuffer, readVarLong.

1.8.9 callers: ServerConfigurationManager.onSizeChanged sends new S44PacketWorldBorder (line 231): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/server/management/ServerConfigurationManager.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.