Skip to content

Snap Items ​

This page describes the snap items structure, all kinds of snap items, and their purpose.

Item IDName
0Unused
1Unused
2NETOBJTYPE_PROJECTILE
3NETOBJTYPE_LASER
4NETOBJTYPE_PICKUP
5NETOBJTYPE_FLAG
6NETOBJTYPE_GAMEINFO
7NETOBJTYPE_GAMEDATA
8Unused
9NETOBJTYPE_CHARACTER
10NETOBJTYPE_PLAYERINFO
11NETOBJTYPE_CLIENTINFO
12NETOBJTYPE_SPECTATORINFO
13Unused
14NETEVENTTYPE_EXPLOSION
15NETEVENTTYPE_SPAWN
16NETEVENTTYPE_HAMMERHIT
17NETEVENTTYPE_DEATH
18NETEVENTTYPE_SOUNDGLOBAL (DDNet Only)
19NETEVENTTYPE_SOUNDWORLD
20NETEVENTTYPE_DAMAGEIND

2 - NETOBJTYPE_PROJECTILE ​

This item represents a projectile entity (bullet, grenade, or shotgun pellet) in the game world. Structure:

FieldTypeDescription
XIntegerProjectile X position in the world.
YIntegerProjectile Y position in the world.
VelocityXIntegerHorizontal velocity of the projectile, scaled by 100.
VelocityYIntegerVertical velocity of the projectile, scaled by 100.
TypeIntegerWeapon type that fired this projectile: 1 = gun, 2 = shotgun, 3 = grenade.
StartTickIntegerGame tick at which the projectile was created. Used by the client to compute its current position using physics formulas.

3 - NETOBJTYPE_LASER ​

This item represents a laser beam in the game world. Structure:

FieldTypeDescription
XIntegerLaser endpoint X position.
YIntegerLaser endpoint Y position.
FromXIntegerLaser origin X position (where the tee fired from).
FromYIntegerLaser origin Y position (where the tee fired from).
StartTickIntegerGame tick at which the laser was fired. Used by the client to render the laser beam correctly over time.

4 - NETOBJTYPE_PICKUP ​

This item represents a pickup (health, armor, or weapon) in the game world. Structure:

FieldTypeDescription
XIntegerPickup X position in the world.
YIntegerPickup Y position in the world.
TypeIntegerPickup type: 0 = health, 1 = armor, 2 = grenade, 3 = shotgun, 4 = laser, 5 = ninja, 6 = gun, 7 = hammer.

5 - NETOBJTYPE_FLAG ​

This item represents a CTF flag in the game world. Structure:

FieldTypeDescription
XIntegerFlag X position in the world.
YIntegerFlag Y position in the world.
TeamIntegerFlag team: 0 = red team flag, 1 = blue team flag.

6 - NETOBJTYPE_GAMEINFO ​

This item contains game information about team scores and flag carriers for CTF mode. Structure:

FieldTypeDescription
TeamScoreRedIntegerCurrent score of the red team.
TeamScoreBlueIntegerCurrent score of the blue team.
FlagCarrierRedIntegerClient ID of the red flag carrier, or -3 if lost, -2 if at base, -1 if taken.
FlagCarrierBlueIntegerClient ID of the blue flag carrier, or -3 if lost, -2 if at base, -1 if taken.

7 - NETOBJTYPE_GAMEDATA ​

This item contains global game state data. Structure:

FieldTypeDescription
GameFlagsIntegerGame mode flags (bitmask): 1 = teams mode, 2 = CTF flags enabled, 4 = survival mode, 8 = race mode.
GameStateFlagsIntegerGame state flags (bitmask): 1 = warmup, 2 = sudden death, 4 = round over, 8 = game over, 16 = paused, 32 = start countdown.
RoundStartTickIntegerGame tick when the current round started.
WarmupTimerIntegerRemaining warmup time, or a special value indicating the game state.
ScoreLimitIntegerScore limit for the current match.
TimeLimitIntegerTime limit for the current match.
RoundNumIntegerTotal number of rounds in the match.
RoundCurrentIntegerCurrent round number (1 based).

9 - NETOBJTYPE_CHARACTER ​

This item represents a character (tee) in the game world, including its core physics and state. The payload contains 22 integers: 15 core fields followed by 7 character fields, in the order below.

Structure:

FieldTypeDescription
Core -> TickIntegerGame tick of the core state used for dead reckoning. 0 disables dead reckoning, including while the world is paused.
Core -> XIntegerCore X position in the world.
Core -> YIntegerCore Y position in the world.
Core -> VelXIntegerHorizontal velocity, scaled by 256. Divide by 256 to obtain world units per tick.
Core -> VelYIntegerVertical velocity, scaled by 256. Divide by 256 to obtain world units per tick.
Core -> AngleIntegerAim angle in radians, multiplied by 256.
Core -> DirectionIntegerCore movement direction: -1 = left, 0 = neutral, 1 = right.
Core -> JumpedIntegerJump state bitmask: 1 = the current jump press has been used, 2 = the air jump has been used. See Jump State & Effects.
Core -> HookedPlayerIntegerClient ID of the player this tee is hooking, or -1 if not hooking a player.
Core -> HookStateIntegerHook state: -1 = retracted, 0 = idle, 1-3 = retracting, 4 = flying, 5 = grabbed.
Core -> HookTickIntegerTick counter while the hook is grabbed, used to limit player-hook duration.
Core -> HookXIntegerHook endpoint X position in the world.
Core -> HookYIntegerHook endpoint Y position in the world.
Core -> HookDxIntegerHook direction X component, scaled by 256.
Core -> HookDyIntegerHook direction Y component, scaled by 256.
PlayerFlagsIntegerPlayer state flags (bitmask): 1 = playing, 2 = in menu, 4 = chatting, 8 = scoreboard open.
HealthIntegerCurrent health of the character (0-10). Hidden values are sent as 0.
ArmorIntegerCurrent armor of the character (0-10). Hidden values are sent as 0.
AmmoCountIntegerAmmunition count for the active weapon (0-10). Unlimited ammunition, including ninja, is sent as 0; this field does not contain ninja duration. Hidden values are also sent as 0.
WeaponIntegerCurrently active weapon: 0 = hammer, 1 = gun, 2 = shotgun, 3 = grenade, 4 = laser, 5 = ninja.
EmoteIntegerCurrent emote: 0 = normal, 1 = pain, 2 = happy, 3 = surprise, 4 = angry, 5 = blink.
AttackTickIntegerGame tick of the last attack, used by the client for attack animations.

By default, the original 0.6 server sends Health, Armor, and AmmoCount to the owning player, permitted spectators following that player, and demo recording. Other clients receive 0 for these fields.

INFO

This visibility rule is a server policy, not a restriction imposed by the protocol. Depending on the mod, you may want to expose these values to teammates or all players. Any client receiving them can read them, even if its interface does not display them.

INFO

TriggeredEvents is internal character-core state, not a field in the protocol character payload. Do not append it to this item.

Jump State & Effects ​

The Jumped field contains two independent bits:

MaskMeaning
1A jump was triggered by the current button press. Cleared when the jump button is released.
2The air jump has been used. Cleared on ground contact.

Jumped is not a jump counter. For example, 2 means the air jump has been used and the button has been released; 0 does not necessarily mean the character is grounded.

The client creates the double-jump particles and sound when Jumped & 2 changes from 0 to 2. For the local character, this uses the predicted core when prediction is enabled. Other characters use the snapshot core state. There is no separate air-jump event item to send.

Ninja & Prediction ​

The client predicts normal character-core physics, not the ninja dash itself. The server moves the character for each dash step and then resets the dash velocity to (0, 0), so the client does not extrapolate the dash speed as ordinary movement.

Dash positions arrive through character snapshots. When the dash ends, the server should restore the pre-dash speed along the dash direction, and normal core prediction continues from the velocity in subsequent snapshots.

10 - NETOBJTYPE_PLAYERINFO ​

This item contains information about a player's score and latency. Structure:

FieldTypeDescription
LocalIntegerWhether this player is the local client (1 for the client itself, 0 for other players).
ClientIDIntegerClient ID of this player.
TeamIntegerTeam the player is on: -1 = spectators, 0 = red team, 1 = blue team.
ScoreIntegerPlayer's current score.
LatencyIntegerPlayer's current latency/ping in milliseconds.

11 - NETOBJTYPE_CLIENTINFO ​

This item contains identity and skin information about a client. Structure:

FieldTypeDescription
NameString[16]Player name (packed as integers for snap items).
ClanString[12]Player clan (packed as integers for snap items).
CountryIntegerCountry code for the player.
SkinString[20]Skin name (packed as integers for snap items).
Use Custom ColorIntegerWhether the player uses custom skin colors.
Color BodyIntegerBody color value.
Color FeetIntegerFeet color value.

INFO

Check the String Packing To Snap Items section for more information about the string packing for snap items.

12 - NETOBJTYPE_SPECTATORINFO ​

This item contains the spectator state of a player. It is only sent to the local spectator (the snapping client itself) when their team is TEAM_SPECTATORS.

Structure:

FieldTypeDescription
SpectatorIDIntegerClient ID being spectated, or -1 (SPEC_FREEVIEW) when in free view mode.
XIntegerSpectator camera X position in the world.
YIntegerSpectator camera Y position in the world.

14 - NETEVENTTYPE_EXPLOSION ​

This event creates an explosion effect at the given position. It is a transient event that does not persist across snapshots. Structure:

FieldTypeDescription
XIntegerX position of the explosion center in the world.
YIntegerY position of the explosion center in the world.

15 - NETEVENTTYPE_SPAWN ​

This event creates a spawn effect at the given position when a player respawns. Structure:

FieldTypeDescription
XIntegerX position of the spawn effect in the world.
YIntegerY position of the spawn effect in the world.

16 - NETEVENTTYPE_HAMMERHIT ​

This event creates a hammer hit effect at the given position. Structure:

FieldTypeDescription
XIntegerX position of the hammer hit effect in the world.
YIntegerY position of the hammer hit effect in the world.

17 - NETEVENTTYPE_DEATH ​

This event signals a player death at the given position. Structure:

FieldTypeDescription
XIntegerX position of the death event in the world.
YIntegerY position of the death event in the world.
ClientIDIntegerClient ID of the player that died.

18 - NETEVENTTYPE_SOUNDGLOBAL ​

This event triggers a global sound (not tied to a world position). Structure:

FieldTypeDescription
SoundIDIntegerSound ID to play globally.

19 - NETEVENTTYPE_SOUNDWORLD ​

This event triggers a world sound at the given position. Structure:

FieldTypeDescription
XIntegerX position of the sound source in the world.
YIntegerY position of the sound source in the world.
SoundIDIntegerSound ID to play at this position.

20 - NETEVENTTYPE_DAMAGEIND ​

This event creates a damage indicator at the given position, showing damage direction and amount. Structure:

FieldTypeDescription
XIntegerX position of the damage effect in the world.
YIntegerY position of the damage effect in the world.
AngleIntegerAngle of the damage source, used to orient the damage indicator.