Multiplayer Packet Structure (v1.4.5.6) - Pryaxis/TShock GitHub Wiki

Table of Contents

Packet Structure

Offset Size Description Type Notes
0 2 Packet length in bytes UInt16 -
2 1 Packet Type/ID UInt8 Use TSAPI's Packetypes.PacketName enum for packet ID's
3 ? Data ? See the rest of the page for data structures

Connect Request [1]

Client -> Server

Size Description Type Notes
? Version String "Terraria" + Main.curRelease

Disconnect [2]

Server -> Client

Size Description Type Notes
? Reason NetworkText -

Set User Slot [3]

Server -> Client

Size Description Type Notes
1 Player ID Byte -
1 Server Special Flags Bool -

Player Info [4]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte
1 Skin Variant Byte
1 Voice Variant Byte 1 = Male, 2 = Female, 3 = Other
4 Voice Pitch Offset Single
1 Hair Byte
? Name String
1 Hair Dye Byte
2 Accessory Visibility UInt16 Bitwise array for player.hideVisibileAccessory[10]
1 Hide Misc Byte
3 Hair Color Color
3 Skin Color Color
3 Eye Color Color
3 Shirt Color Color
3 Under Shirt Color Color
3 Pants Color Color
3 Shoe Color Color
1 Difficulty Flags Byte BitFlags: 1 = MediumCore, 2 = Hardcore, 4 = ExtraAccessory, 8 = Journey
1 Additional Flags 1 Byte BitFlags: 1 = UsingBiomeTorches, 2 = happyFunTorchTime, 4 = unlockedBiomeTorches, 8 = unlockedSuperCart, 16 = enabledSuperCart
1 Additional Flags 2 Byte BitFlags: 1 = usedAegisCrystal, 2 = usedAegisFruit, 4 = usedArcaneCrystal, 8 = usedGalaxyPearl, 16 = usedGummyWorm, 32 = usedAmbrosia, 64 = ateArtisanBread

Player Inventory Slot [5]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 Slot ID Int16 0 - 58 = Inventory, 59 - 78 = Armor, 79 - 88 = Dye, 89 - 93 MiscEquips, 94 - 98 = MiscDyes, 99 - 138 = Piggy bank, 139 - 178 = Safe, 179 = Trash, 180 - 219 = Defender's Forge, 220 - 259 = Void Vault
2 Stack Int16 -
1 Prefix Byte -
2 Item NetID Int16 -
1 Favorited Flags Byte BitFlags: 1 = Favorited, 2 = Blocked

Request World Data [6]

Client -> Server

Size Description Type Notes

World Info [7]

Server -> Client

Size Description Type Notes
4 Time Int32 -
1 Day and Moon Info Byte BitFlags: 1 = Day Time, 2 = Blood Moon, 4 = Eclipse
1 Moon Phase Byte -
2 Max Tiles X Int16 -
2 Max Tiles Y Int16 -
2 Spawn Tile X Int16 -
2 Spawn Tile Y Int16 -
2 WorldSurface Int16 -
2 RockLayer Int16 -
4 World ID Int32 -
? World Name String -
1 Game Mode Byte -
16 World Unique ID Byte[] -
8 World Generator Version UInt64 -
1 Moon Type Byte -
1 Tree Background 1 Byte -
1 Tree Background 2 Byte -
1 Tree Background 3 Byte -
1 Tree Background 4 Byte -
1 Corruption Background Byte -
1 Jungle Background Byte -
1 Snow Background Byte -
1 Hallow Background Byte -
1 Crimson Background Byte -
1 Desert Background Byte -
1 Ocean Background Byte -
1 Mushroom Background Byte -
1 Underworld Background Byte -
1 Ice Back Style Byte -
1 Jungle Back Style Byte -
1 Hell Back Style Byte -
4 Wind Speed Set Single -
1 Cloud Number Byte -
4 Tree 1 Int32 -
4 Tree 2 Int32 -
4 Tree 3 Int32 -
1 Tree Style 1 Byte -
1 Tree Style 2 Byte -
1 Tree Style 3 Byte -
1 Tree Style 4 Byte -
4 Cave Back 1 Int32 -
4 Cave Back 2 Int32 -
4 Cave Back 3 Int32 -
1 Cave Back Style 1 Byte -
1 Cave Back Style 2 Byte -
1 Cave Back Style 3 Byte -
1 Cave Back Style 4 Byte -
1 Forest 1 Tree Top Style Byte -
1 Forest 2 Tree Top Style Byte -
1 Forest 3 Tree Top Style Byte -
1 Forest 4 Tree Top Style Byte -
1 Corruption Tree Top Style Byte -
1 Jungle Tree Top Style Byte -
1 Snow Tree Top Style Byte -
1 Hallow Tree Top Style Byte -
1 Crimson Tree Top Style Byte -
1 Desert Tree Top Style Byte -
1 Ocean Tree Top Style Byte -
1 Glowing Mushroom Tree Top Style Byte -
1 Underworld Tree Top Style Byte -
4 Rain Single -
1 Event Info Byte BitFlags: 1 = Shadow Orb Smashed, 2 = Downed Boss 1, 4 = Downed Boss 2, 8 = Downed Boss 3, 16 = Hard Mode, 32 = Downed Clown, 64 = Server Side Character, 128 = Downed Plant Boss
1 Event Info 2 Byte BitFlags: 1 = Downed Mech Boss 1, 2 = Downed Mech Boss 2, 4 = Downed Mech Boss 3, 8 = Downed Mech Boss Any, 16 = Cloud BG Active, 32 = Crimson, 64 = Pumpkin Moon, 128 = Snow Moon
1 Event Info 3 Byte BitFlags: 2 = FastForwardTimeToDawn, 4 = Slime Rain, 8 = Downed Slime King, 16 = Downed Queen Bee, 32 = Downed Fishron, 64 = Downed Martians, 128 = Downed Ancient Cultist
1 Event Info 4 Byte BitFlags: 1 = Downed Moon Lord, 2 = Downed Pumking, 4 = Downed Mourning Wood, 8 = Downed Ice Queen, 16 = Downed Santank, 32 = Downed Everscream, 64 = Downed Golem, 128 = Birthday Party
1 Event Info 5 Byte BitFlags: 1 = Downed Pirates, 2 = Downed Frost Legion, 4 = Downed Goblins, 8 = Sandstorm, 16 = DD2 Event, 32 = Downed DD2 Tier 1, 64 = Downed DD2 Tier 2, 128 = Downed DD2 Tier 3
1 Event Info 6 Byte BitFlags: 1 = Combat Book Used, 2 = Manual Lanterns, 4 = Downed Solar Tower, 8 = Downed Vortex Tower, 16 = Downed Tower Nebula, 32 = Downed Stardust Tower, 64 = Force Halloween For Today, 128 = Force XMas For Today
1 Event Info 7 Byte BitFlags: 1 = Bought Cat, 2 = Bought Dog, 4 = Bought Bunny, 8 = Free Cake, 16 = Drunk World, 32 = Downed Empress of Light, 64 = Downed Queen Slime, 128 = GetGoodWorld
1 Event Info 8 Byte BitFlags: 1 = 10th Anniversary Worlds, 2 = Don't Starve World, 4 = Downed Deer Clops, 8 = Not The Bees World, 16 = Remix World, 32 = Unlocked Slime Blue Spawn, 64 = Combat Book Volume Two Was Used, 128 = Peddler's Satchel Was Used
1 Event Info 9 Byte BitFlags: 1 = Unlocked Slime Green Spawn, 2 = Unlocked Slime Old Spawn, 4 = Unlocked Slime Purple Spawn, 8 = Unlocked Slime Rainbow Spawn, 16 = Unlocked Slime Red Spawn, 32 = Unlocked Slime Yellow Spawn, 64 = Unlocked Slime Copper Spawn, 128 = Fast Forward Time To Dusk
1 Event Info 10 Byte BitFlags: 1 = No Traps World, 2 = Zenith World, 4 = Unlocked Truffle Spawn, 8 = Vampire Seed, 16 = Infected Seed, 32 = Team-Based Spawn Seed, 64 = Sky Block World, 128 = Dual Dungeons Seed
1 Skyblock Info Byte BitFlags: 1 = Low Tiles
1 Sundial Cooldown Byte -
1 Moondial Cooldown Byte -
2 Copper Ore Tier Int16 Tile ID 7 or 166
2 Iron Ore Tier Int16 Tile ID 6 or 167
2 Silver Ore Tier Int16 Tile ID 9 or 168
2 Gold Ore Tier Int16 Tile ID 8 or 169
2 Cobalt Ore Tier Int16 Tile ID 107 or 221
2 Mythril Ore Tier Int16 Tile ID 108 or 222
2 Adamantite Ore Tier Int16 Tile ID 111 or 223
1 Invasion Type SByte 1 = Goblins, 2 = Frostmoon, 3 = Pirates, 4 = Martians
8 Lobby ID UInt64 -
4 Sandstorm Severity Single -
1 Number of Team-Based Spawn Points Byte Used for team-based spawn points
2 Team-Based Spawn Point X Int16 Team-Based Spawn Points X & Y are repeated based on "Number of Team-Based Spawn Points" above, if any
2 Team-Based Spawn Point Y Int16 Team-Based Spawn Points X & Y are repeated based on "Number of Team-Based Spawn Points" above, if any

Request Essential Tiles [8]

This packet is used once in the connecting phase and does the following:

  1. Sends you the spawn sections
  2. Optionally, if spawn coords aren't -1 - sends you the sections of the selected position (which is the player's spawnpoint)
  3. Synchronizes all portals and sections around them

Client -> Server

Size Description Type Notes
4 X Int32 Player Spawn X
4 Y Int32 Player Spawn Y
1 Team-Based Spawn Byte -

Status [9]

Server -> Client

Size Description Type Notes
4 StatusMax Int32 Status only increases
? Status Text NetworkText -
1 Status Text Flags Byte 1 = HideStatusTextPercent, 2 = StatusTextHasShadows, 4 = ServerWantsToRunCheckBytesInClientLoopThread

Send Section [10]

Server -> Client

Size Description Type Notes
4 X Start Int32 -
4 Y Start Int32 -
2 Width Int16 -
2 Height Int16 -
? Tiles -
2 Chest Count Int16 -
? Chests -
2 Sign Count Int16 -
? Signs -
2 TileEntity Count Int16 -
? TileEntities - -

Section Tile Frame [11]

Server -> Client

Size Description Type Notes
2 Start X Int16 -
2 Start Y Int16 -
2 End X Int16 -
2 End Y Int16 -

Spawn Player [12]

Client -> Server

Size Description Type Notes
1 Player ID Byte
2 Spawn X Int16
2 Spawn Y Int16
4 Respawn Time Remaining Int32
2 Number of PvE Deaths Int16
2 Number of PvP Deaths Int16
1 Team Byte
1 Player Spawn Context Byte Enum: 0 = ReviveFromDeath, 1 = SpawningIntoWorld, 2 = RecallFromItem, 3 = TeamSwap

Update Player [13]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
1 Control Byte BitFlags: 1 = ControlUp, 2 = ControlDown, 4 = ControlLeft, 8 = ControlRight, 16 = ControlJump, 32 = ControlUseItem, 64 = Direction
1 Info 1 Byte BitFlags: 1 = Pulley Enabled, 2 = Direction, 4 = UpdateVelocity, 8 = VortexStealthActive, 16 = GravityDirection, 32 = ShieldRaised, 64 = Ghost, 128 = SetMount
1 Info 2 Byte BitFlags: 1 = HoveringUp, 2 = VoidVaultEnabled, 4 = Sitting, 8 = DownedDD2Event, 16 = IsPettingAnimal, 32 = IsPettingSmallAnimal, 64 = UsedPotionofReturn, 128 = HoveringDown
1 Info 3 Byte BitFlags: 1 = PlayerSleeping, 2 = AutoReuseAllWeapons, 4 = ControlDownHold, 8 = IsOperatingAnotherEntity, 16 = ControlUseTile, 32 = NetCameraTarget, 64 = LastItemUseAttemptSuccess
1 Selected Item Byte -
4 Position X Single -
4 Position Y Single -
4 Velocity X Single Only sent if UpdateVelocity flag is true
4 Velocity Y Single Only sent if UpdateVelocity flag is true
2 Mount ID UInt16 Only sent if SetMount flag is true
4 Original Position X Single Original Position for Potion of Return, only sent if UsedPotionofReturn flag is true
4 Original Position Y Single Original Position for Potion of Return, only sent if UsedPotionofReturn flag is true
4 Home Position X Single Home Position for Potion of Return, only sent if UsedPotionofReturn flag is true
4 Home Position Y Single Home Position for Potion of Return, only sent if UsedPotionofReturn flag is true
4 Camera Target X Single Only sent if NetCameraTarget flag is true
4 Camera Target Y Single Only sent if NetCameraTarget flag is true

Player Active [14]

Server -> Client

Size Description Type Notes
1 Player ID Byte -
1 Active Byte -

Null [15]

Never sent

Size Description Type Notes

Player HP [16]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 HP Int16 -
2 Max HP Int16 -

Modify Tile [17]

Server <-> Client (Sync)

Size Description Type Notes
1 Action Byte Values: 0 = KillTile, 1 = PlaceTile, 2 = KillWall, 3 = PlaceWall, 4 = KillTileNoItem, 5 = PlaceWire, 6 = KillWire, 7 = PoundTile, 8 = PlaceActuator, 9 = KillActuator, 10 = PlaceWire2, 11 = KillWire2, 12 = PlaceWire3, 13 = KillWire3, 14 = SlopeTile, 15 = FrameTrack, 16 = PlaceWire4, 17 = KillWire4, 18 = PokeLogicGate, 19 = Actuate, 20 = KillTile, 21 = ReplaceTile, 22 = ReplaceWall, 23 = SlopePoundTile
2 Tile X Int16 -
2 Tile Y Int16 -
2 Flags1 Int16 KillTile (Fail: Bool), PlaceTile (Type: Byte), KillWall (Fail: Bool), PlaceWall (Type: Byte), KillTileNoItem (Fail: Bool), SlopeTile (Slope: Byte), ReplaceTile (Type: UInt16), ReplaceWall (Type: UInt16)
1 Flags2 Byte PlaceTile (Style: Byte), ReplaceTile (Style: Byte)

Time [18]

Server -> Client

Size Description Type Notes
1 DayTime Boolean -
4 TimeValue Int32 -
2 SunModY Int16 -
2 MoonModY Int16 -

Door Toggle [19]

Server <-> Client (Sync)

Size Description Type Notes
1 Action Byte 0 = Open Door, 1 = Close Door, 2 = Open Trapdoor, 3 = Close Trapdoor, 4 = Open Tall Gate, 5 = Close Tall Gate
2 Tile X Int16 -
2 Tile Y Int16 -
1 Direction Byte If (Action == 0) then (if (Direction == -1) then OpenToLeft else OpenToRight) if (Action == 2) then (if (Direction == 1) then PlayerIsAboveTrapdoor) if (Action == 3) then (if (Direction == 1) then PlayerIsAboveTrapdoor)

Send Tile Square [20]

Server <-> Client (Sync)

Size Description Type Notes
2 Tile X Int16 -
2 Tile Y Int16 -
1 Size X Byte -
1 Size Y Byte -
1 TileChangeType Byte Enum: 0 = None, 1 = LavaWater, 2 = HoneyWater, 3 = HoneyLava, 4 = ShimmerWater, 5 = ShimmerLava, 6 = ShimmerHoney
? Tiles - -

Item Drop [21]

Server <-> Client (Sync)

Size Description Type Notes
2 Item ID Int16 If below 400 and NetID 0 Then Set NullIf ItemID is 400 Then New Item
4 Position X Single -
4 Position Y Single -
4 Velocity X Single -
4 Velocity Y Single -
2 Stack Int16 -
1 Prefix Byte -
1 NoDelay Byte If 0 then ownIgnore = 0 and ownTime = 100
2 Item Net ID Int16 -

Item Owner [22]

Server <-> Client (Sync)

Size Description Type Notes
2 Item ID Int16 -
1 Player ID Byte -
4 Position X Single -
4 Position Y Single -

NPC Update [23]

Server -> Client

Size Description Type Notes
2 NPC ID Int16 -
4 Position X Single -
4 Position Y Single -
4 Velocity X Single -
4 Velocity Y Single -
2 Target UInt16 Player ID
1 NPC Flags 1 Byte BitFlags: 1 = Direction, 2 = DirectionY, 4 = AI[0], 8 = AI[1], 16 = AI[2], 32 = AI[3], 64 = SpriteDirection, 128 = LifeMax
1 NPC Flags 2 Byte BitFlags: 1 = StatsScaled, 2 = SpawnedFromStatue, 4 = StrengthMultiplier, 8 = SpawnNeedsSyncing, 16 = ShimmerTransparency
? NPC AI Single[] Only sent for each true AI flag in NPC Flags 1
2 NPC NetID Int16 -
1 playerCountForMultiplayerDifficultyOverride Byte Only sent if StatsScaled flag is true
4 Strength Multiplier Single Only sent if StrengthMultiplier flag is true
1 Life Size Flag Byte The size of Life (in bytes), only sent if LifeMax flag is not true
1 Life SByte Only sent if Life Size Flag = 1
2 Life Int16 Only sent if Life Size Flag = 2
4 Life Int32 Only sent if Life Size Flag = 4
1 ReleaseOwner Byte Only present if NPC is catchable

Strike NPC with Held Item [24]

Server <-> Client (Sync)

Size Description Type Notes
2 NPC ID Int16 -
1 Player ID Byte -

Null [25]

Never sent

Size Description Type Notes

Null [26]

Never sent

Size Description Type Notes

Projectile Update [27]

Server <-> Client (Sync)

Size Description Type Notes
2 Projectile ID Int16 -
4 Position X Single -
4 Position Y Single -
4 Velocity X Single -
4 Velocity Y Single -
1 Owner Byte Player ID
2 Type Int16 -
1 ProjFlags Byte BitFlags: 1 = AI[0], 2 = AI[1], 4 = ProjFlags2, 8 = BannerIdToRespondTo, 16 = Damage, 32 = Knockback, 64 = OriginalDamage, 128 = ProjUUID
1 ProjFlags2 Byte BitFlags: 1 = AI[2], Only sent if ProjFlags2 flag is true
4 AI 0 Single Only sent if AI[0] flag is true
4 AI 1 Single Only sent if AI[1] flag is true
2 BannerIdToRespondTo UInt16 Only sent if BannerIdToRespondTo flag is true
2 Damage Int16 Only sent if Damage flag is true
4 Knockback Single Only sent if Knockback flag is true
2 Original Damage Int16 Only sent if OriginalDamage flag is true
2 Proj UUID Int16 Only sent if ProjUUID flag is true
4 AI 2 Single Only sent if AI[2] flag is true

NPC Strike [28]

Server <-> Client (Sync)

Size Description Type Notes
2 NPC ID Int16 -
2 Damage Int16 -1 = Kill
4 Knockback Single -
1 Hit Direction Byte -
1 Crit Byte -

Destroy Projectile [29]

Server <-> Client (Sync)

Size Description Type Notes
2 Projectile ID Int16 -
1 Owner Byte Player ID

Toggle P V P [30]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
1 PVP Enabled Boolean -

Open Chest [31]

Client -> Server

Size Description Type Notes
2 Tile X Int16 -
2 Tile Y Int16 -

Packet [31] is always used to "open" a world chest (that is, an item container placed in the world). When this packet is received the server will send the chest's contents, and sync the active chest ID to the player using packet [33].

Update Chest Item [32]

Server <-> Client (Sync)

Size Description Type Notes
2 Chest ID Int16 -
1 Item Slot Byte -
2 Stack Int16 -
1 Prefix Byte -
2 Item Net ID Int16 -

Sync Active Chest [33]

Server <-> Client (Sync)

Size Description Type Notes
2 Chest ID Int16 -
2 Chest X Int16 -
2 Chest Y Int16 -
1 Name Length Byte -
? Chest Name String Only if length > 0 && <= 20

This packet is used to tell the server that you've exited the chest view (sending ID -1), that you're looking at your piggy bank (sending ID -2), that you're looking at your safe (sending ID -3) and that you're looking at your defender's forge (sending ID -4). Those are sent at every chest interaction. Packet [33]'s main function is to synchronize the sending client's active chest to the server, and its side function is to rename the chest.
It should be noted that this packet is not sent when you open a regular chest. The server knows which chest you opened when you send [31], so the [33] is only sent upon exit to unblock the chest (as opposed to both open & exit for banks like piggy, safe & defender forge)

PlaceChest [34]

Server <-> Client

Size Description Type Notes
1 Action Byte BitFlags: 0 = Place Chest, 1 = Kill Chest, 2 = Place Dresser, 3 = Kill Dresser. 4 = Place Containers2, 5 = Kill Containers2
2 Tile X Int16 -
2 Tile Y Int16 -
2 Style Int16 FrameX(Chest type)
2 Chest ID to destroy Int16 ID if client is receiving packet, else 0

Heal Effect [35]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 Heal Amount Int16 -

Player Zone [36]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
1 ZoneFlags1 Byte 1 = Dungeon, 2 = Corruption, 4 =Holy, 8 = Meteor, 16 = Jungle, 32 = Snow, 64 = Crimson, 128 = Water Candle
1 ZoneFlags2 Byte 1 = Peace Candle, 2 = Solar Tower, 4 = Vortex Tower, 8 = Nebula Tower, 16 = Stardust Tower, 32 = Desert, 64 = Glowshroom, 128 = Underground Desert
1 ZoneFlags3 Byte 1 = Sky, 2 = Overworld, 4 = Dirt Layer, 8 = Rock Layer, 16 = Underworld, 32 = Beach, 64 = Rain, 128 = Sandstorm
1 ZoneFlags4 Byte 1 = Old One's Army, 2 = Granite, 4 = Marble, 8 = Hive, 16 = Gem Cave, 32 = Lihzhard Temple, 64 = Graveyard, 128 = Shadow Candle
1 ZoneFlags5 Byte 1 = Shimmer
1 Town NPCs Count Byte -

Request Password [37]

Server -> Client

Size Description Type Notes

Send Password [38]

Client -> Server

Size Description Type Notes
? Password String -

Remove Item Owner [39]

Server -> Client

Size Description Type Notes
2 Item Index Int16 -

Set Active NPC [40]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 NPC Talk Target Int16 -

Player Item Animation [41]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
4 Item Rotation Single -
2 Item Animation Int16 -

Player Mana [42]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 Mana Int16 -
2 Max Mana Int16 -

Mana Effect [43]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 Mana Amount Int16 -

Null [44]

Never sent

Size Description Type Notes

Player Team [45]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
1 Team Byte -

Request Sign [46]

Client -> Server

Size Description Type Notes
2 X Int16 -
2 Y Int16 -

Update Sign [47]

Updates sign if sent from client otherwise displays sign to client.

Size Description Type Notes
2 Sign ID Int16 -
2 X Int16 -
2 Y Int16 -
? Text String -
1 Player ID Byte -
1 SignFlags Byte BitFlags: 1 = Tombstone

Set Liquid [48]

Server <-> Client (Sync)

Size Description Type Notes
2 X Int16 -
2 Y Int16 -
1 Liquid Byte -
1 Liquid Type Byte -

Complete Connection and Spawn [49]

Server -> Client

Size Description Type Notes
- - - -

Update Player Buff [50]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 BuffType UInt16 Sender loops through Player.maxBuffs[44] and sends if player.buffType[i] > 0
2 End UInt16 Sends a "0" value for receiver to stop reading

Special NPC Effect [51]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
1 Type Byte Values: 1 = Spawn Skeletron, 2 = Cause sound at player, 3 = Start Sundialing (if server is receiving), 4 = BigMimcSpawnSmoke, 5 = Register Torch God in Bestiary (from client when they use the item), 6 = Start Moondialing (if server is receiving)

Unlock [52]

Server <-> Client (Sync)

Size Description Type Notes
1 Type Byte Values: 1 = Chest Unlock, 2 = Door Unlock
2 X Int16 -
2 Y Int16 -

Add NPC Buff [53]

Server <-> Client (Sync)

Size Description Type Notes
2 NPC ID Int16 -
2 Buff UInt16 -
2 Time Int16 -

Update NPC Buff [54]

Server -> Client

Size Description Type Notes
2 NPC ID Int16 -
2 Buff Type UInt16 Server loops through NPC.maxBuffs[20] and only sends if Buff Type > 0 and Buff Time > 0
2 Buff Time UInt16 Server loops through NPC.maxBuffs[20] and only sends if Buff Type > 0 and Buff Time > 0
2 End UInt16 Sends a "0" value for client to stop reading

Add Player Buff [55]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 Buff UInt16 -
4 Time Int32 -

Update NPC Name [56]

Server <-> Client (Sync)

Size Description Type Notes
2 NPC ID Int16 -
? Name String Only if client is receiving packet
4 TownNpcVariationIndex Int32 Only if client is receiving packet

Update Good Evil [57]

Server -> Client

Size Description Type Notes
1 Good Byte -
1 Evil Byte -
1 Crimson Byte -

Play Music Item [58]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
4 Note Single -

Hit Switch [59]

Server <-> Client (Sync)

Size Description Type Notes
2 X Int16 -
2 Y Int16 -

NPC Home Update [60]

Server <-> Client (Sync)

Size Description Type Notes
2 NPC ID Int16 -
2 Home Tile X Int16 -
2 Home Tile Y Int16 -
1 Status Byte 1 = Remove Home, 2 = Set Home

Spawn Boss Invasion [61]

Client -> Server

Size Description Type Notes
2 Player ID Int16 -
2 Type Int16 Negative Values: -1 = GoblinInvasion, -2 = FrostInvasion, -3 = PirateInvasion, -4 = PumpkinMoon, -5 = SnowMoon, -6 = Eclipse, -7 = Martian Moon, -8 = Impending Doom, -10 = Blood Moon, -11 = Combat Book Used, -12 = Bought Cat, -13 = Bought Dog, -14 = Bought Bunny, -15 = Bought Blue Slime, -16 = MechQueen, -17 = Combat Book Volume Two Used, -18 = Peddler's Satchel Used, -19 = Slime Rain, Positive Values: Spawns any of these NPCs: 4, 13, 50, 126, 125, 134, 127, 128, 131, 129, 130, 222, 245, 266, 370, 657, 668

Player Dodge [62]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
1 Dodge Type Byte 1 = Ninja Dodge 2 = Shadow Dodge, 4 = Brain of Confusion Dodge

Paint Tile [63]

Server <-> Client (Sync)

Size Description Type Notes
2 X Int16 -
2 Y Int16 -
1 Color Byte -
1 Coating Byte 0 = Neither, 1 = Full Bright, 2 = Invisible

Paint Wall [64]

Server <-> Client (Sync)

Size Description Type Notes
2 X Int16 -
2 Y Int16 -
1 Color Byte -
1 Coating Byte 0 = Neither, 1 = Full Bright, 2 = Invisible

Player NPC Teleport [65]

Server <-> Client (Sync)

Size Description Type Notes
1 Flags Byte BitFlags: 0 = Player Teleport (Neither 1 or 2), 1 = NPC Teleport, 2 = Player Teleport to Other Player, 4 = GetPositionFromTarget, 8 = HasExtraInfo
2 Target ID Int16 -
4 X Single -
4 Y Single -
1 Style Byte -
4 ExtraInfo Int32 Only sent if HasExtraInfo flag is true

Heal Other Player [66]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 Heal Amount Int16 -

Null [67]

Never sent

Size Description Type Notes

Client UUID [68]

Client -> Server

Size Description Type Notes
? UUID String -

Get Chest Name [69]

Server <-> Client (Sync)

Size Description Type Notes
2 Chest ID Int16 -
2 Chest X Int16 -
2 Chest Y Int16 -
? Name String -

Catch NPC [70]

Client -> Server

Size Description Type Notes
2 NPC ID Int16 -
1 Player ID Byte -

Release NPC [71]

Client -> Server

Size Description Type Notes
4 X Int32 -
4 Y Int32 -
2 NPC Type Int16 -
1 Style Byte Sent to NPC AI[2]

Travelling Merchant Inventory [72]

Server -> Client

Size Description Type Notes
2*40 Items Int16[40] Each short related to an item type NetID.

Teleportation Potion [73]

Server <-> Client

Size Description Type Notes
1 Type By 0 = Teleportation Potion, 1 = Magic Conch, 2 = Demon Conch, 3 = Shellphone, 4 = Teleportation due to no space at destination = =

Angler Quest [74]

Server -> Client

Size Description Type Notes
1 Quest Byte -
1 Completed Boolean -

Complete Angler Quest Today [75]

Client -> Server

Size Description Type Notes

Number Of Angler Quests Completed [76]

Client -> Server

Size Description Type Notes
1 Player ID Byte -
4 Angler Quests Completed Int32 -
4 Golfer Score Int32 -

Create Temporary Animation [77]

Server -> Client

Size Description Type Notes
2 Animation Type Int16 -
2 Tile Type UInt16 -
2 X Int16 -
2 Y Int16 -

Report Invasion Progress [78]

Server -> Client

Size Description Type Notes
4 Progress Int32 -
4 Max Progress Int32 -
1 Icon SByte -
1 Wave SByte -

Place Object [79]

Server <-> Client

Size Description Type Notes
2 X Int16 -
2 Y Int16 -
2 Type Int16 -
2 Style Int16 -
1 Alternate Byte -
1 Random SByte -
1 Direction Boolean -

Sync Player Chest Index [80]

Server -> Client

Size Description Type Notes
1 Player Byte -
2 Chest Int16 -

Create Combat Text [81]

Server -> Client

Size Description Type Notes
4 X Single -
4 Y Single -
3 Color Color -
4 Heal Amount Int32 -

Load Net Module [82]

Server <-> Client

Offset Size Description Type Notes
3 2 Net Module ID/Type UInt16 Net Modules
5 ? Net Module Data ? -

Note: 82 is sent prior to chat packets in 1.3.5.x. Instructs the server to load a net module.

NPC Kill Count [83]

Never sent

Size Description Type Notes

Set Player Stealth [84]

Server <-> Client (Sync)

Size Description Type Notes
1 Player Byte -
4 Stealth Single -

Force Item Into Nearest Chest [85]

Client -> Server

Size Description Type Notes
4 Number of Items Int32 -
2 * numItems Slot ID Int16 * numItems -
1 Smart Stack Boolean -

Server -> Client

Size Description Type Notes
4 Number of Items Int32 -
2 * numItems Blocked Chests UInt16 * numItems -

Update Tile Entity [86]

Server -> Client

Size Description Type Notes
4 TileEntityId Int32 -
1 UpdateTileFlag Boolean If UpdateTileFlag is false, TileEntity is removed
1 TileEntity Type Byte Only sent if UpdateTileFlag is false
2 X Int16 Only sent if UpdateTileFlag is false
2 Y Int16 Only sent if UpdateTileFlag is false

Place Tile Entity [87]

Client -> Server

Size Description Type Notes
2 X Int16 -
2 Y Int16 -
1 TileEntityType Byte -

Tweak Item [88]

Server -> Client

Size Description Type Notes
2 Item Index Int16 -
1 Flags1 Byte BitFlags: 1 = Color, 2 = Damage, 4 = Knockback, 8 = UseAnimation, 16 = UseTime, 32 = Shoot, 64 = ShootSpeed, 128 = NextFlags
4 Packed Color Value UInt32 if Flags1.Color
2 Damage UInt16 if Flags1.Damage
4 Knockback Single if Flags1.Knockback
2 Use Animation UInt16 if Flags1.UseAnimation
2 Use Time UInt16 if Flags1.UseTime
2 Shoot Int16 if Flags1.Shoot
4 ShootSpeed Float if Flags1.ShootSpeed
1 Flags2 Byte if Flags1.NextFlags, BitFlags: 1 = Width, 2 = Height, 4 = Scale, 8 = Ammo, 16 = UseAmmo, 32 = NotAmmo
2 Width Int16 if Flags2.Width
2 Height Int16 if Flags2.Height
4 Scale Float if Flags2.Scale
2 Ammo Int16 If Flags2.Ammo
2 UseAmmo Int16 If Flags2.UseAmmo
1 NotAmmo Bool If Flags2.NotAmmo

Place Item Frame [89]

Client -> Server

Size Description Type Notes
2 X Int16 -
2 Y Int16 -
2 ItemId Int16 -
1 Prefix Byte -
2 Stack Int16 -

Update Item Drop [90]

Server <-> Client (Sync)

Size Description Type Notes
2 Item ID Int16 If below 400 and NetID 0 Then Set NullIf ItemID is 400 Then New Item
4 Position X Single -
4 Position Y Single -
4 Velocity X Single -
4 Velocity Y Single -
2 Stack Int16 -
1 Prefix Byte -
1 NoDelay Byte If 0 then ownIgnore = 0 and ownTime = 100
2 Item Net ID Int16 -

Sync Emote Bubble [91]

Server -> Client

Size Description Type Notes
4 Emote ID Int32 -
1 Anchor Type Byte -
2 Player ID UInt16 Only sent if AnchorType != 255
2 Emote LifeTime UInt16 Only sent if AnchorType != 255
1 Emote Byte Only sent if AnchorType != 255
2 Emote MetaData Int16 Only sent if AnchorType != 255 and Emote < 0

Sync Extra Value [92]

Server <-> Client (Sync)

Size Description Type Notes
2 NPC Index Int16 -
4 Extra Value Int32 -
4 X Single -
4 Y Single -

Social Handshake [93]

Never sent

Size Description Type Notes

Debug Commands [94]

Not sent

Size Description Type Notes
? Command String "/showdebug" or "/setserverping"
4 - Int32 Always "0"
4 Command Data Single Sets debug options
4 - Single -

Kill Portal [95]

Client -> Server

Size Description Type Notes
2 Projectile Owner UInt16 -
1 Projectile AI Byte -

Player Teleport Portal [96]

Server <-> Client

Size Description Type Notes
1 Player ID Byte -
2 Portal Color Index Int16 -
4 New Position X Single -
4 New Position Y Single -
4 Velocity X Single -
4 Velocity Y Single -

Notify Player NPC Killed [97]

Server -> Client

Size Description Type Notes
2 NPC ID Int16 -

Notify Player Of Event [98]

Server -> Client

Size Description Type Notes
2 Event ID Int16 -

Update Minion Target [99]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
4 Target X Single -
4 Target Y Single -

NPC Teleport Portal [100]

Server <-> Client

Size Description Type Notes
2 NPC ID UInt16 -
2 Portal Color Index Int16 -
4 New Position X Single -
4 New Position Y Single -
4 Velocity X Single -
4 Velocity Y Single -

Update Shield Strengths [101]

Server -> Client

Size Description Type Notes
2 Solar Tower Shield Strength UInt16 -
2 Vortex Tower Shield Strength UInt16 -
2 Nebula Tower Shield Strength UInt16 -
2 Stardust Tower Shield Strength UInt16 -

Nebula Level Up [102]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 Level Up Type UInt16 -
4 Origin X Single In world coordinate pixels.
4 Origin Y Single In world coordinate pixels.

Moon Lord Countdown [103]

Server -> Client

Size Description Type Notes
4 Moon Lord Countdown Max Int32 -
4 Moon Lord Countdown Int32 -

NPC Shop Item [104]

Server -> Client

Size Description Type Notes
1 Slot Byte -
2 Item Type Int16 -
2 Stack Int16 -
1 Prefix Byte -
4 Value Int32 -
1 Flags Byte BitFlags: 1 = BuyOnce

Gem Lock Toggle [105]

Client -> Server

Size Description Type Notes
2 X Int16 -
2 Y Int16 -
1 On Boolean -

Poof of Smoke [106]

Server -> Client

Size Description Type Notes
4 PackedVector UInt32 Two Int16's packed into 4 bytes.

Smart Text Message [107]

Server -> Client

Size Description Type Notes
3 Message Color Color Client cannot change colors
? Message NetworkText -
2 Message Length Int16 -

Wired Cannon Shot [108]

Server -> Client

Size Description Type Notes
2 Damage Int16 -
4 Knockback Single -
2 X Int16 -
2 Y Int16 -
2 Angle Int16 -
2 Ammo Int16 -
1 Player ID Byte Shooter's Player ID

Mass Wire Operation [109]

Client -> Server

Size Description Type Notes
2 Start X Int16 -
2 Start Y Int16 -
2 End X Int16 -
2 End Y Int16 -
1 ToolMode Byte BitFlags: 1 = Red, 2 = Green, 4 = Blue, 8 = Yellow, 16 = Actuator, 32 = Cutter

Mass Wire Operation Consume [110]

Server -> Client

Size Description Type Notes
2 Item Type Int16 -
2 Quantity Int16 -
1 Player ID Byte -

Toggle Birthday Party [111]

Client -> Server

Size Description Type Notes

GrowFX [112]

Server <-> Client (Sync)

Size Description Type Notes
1 EffectFlags Byte 1 = Tree Growth Effects, 2 = Fairy Effects
4 X Int32 -
4 Y Int32 -
1 Data Byte if EffectFlag is TreeGrowth, data is Height; if EffectFlag is Fairy Effects, data is effect Type
2 Tree Gore Int16 Always 0 unless it is TreeGrowth
1 Hit Tree Byte -

CrystalInvasionStart [113]

Client -> Server

Size Description Type Notes
2 X Int16 -
2 Y Int16 -

CrystalInvasionWipeAll [114]

Server -> Client

Size Description Type Notes

MinionAttackTargetUpdate [115]

Client -> Server

Size Description Type Notes
1 Player ID Byte -
2 Minion Attack Target Int16 -

CrystalInvasionSendWaitTime [116]

Server -> Client

Size Description Type Notes
4 Time Until Next Wave Int32 1800 (30s) between waves, 30 (5s) when starting

PlayerHurtV2 [117]

Client -> Server

Size Description Type Notes
1 Player ID Byte -
? Player Death Reason PlayerDeathReason -
2 Damage Int16 -
1 Hit Direction Byte -
1 Flags Byte BitFlags: 1 = Crit, 2 = PvP
1 Cooldown Counter SByte -

PlayerDeathV2 [118]

Client -> Server

Size Description Type Notes
1 Player ID Byte -
? Player Death Reason PlayerDeathReason -
2 Damage Int16 -
1 Hit Direction Byte -
1 Flags Byte BitFlags: 1 = PvP

CombatTextString [119]

Server -> Client

Size Description Type Notes
4 X Single -
4 Y Single -
3 Color Color -
? Combat Text NetworkText -

Emoji [120]

Client -> Server

Size Description Type Notes
1 Player Index Byte -
1 Emoticon ID Byte -

TileEntity Display Doll Item Sync [121]

Client <-> Server

Size Description Type Notes
1 Player ID Byte -
4 TileEntity ID Int32 -
1 Item Index Byte -
1 Command Byte 1 = Dyes, 2 = Pose, 3 = Misc
1 Pose Byte Only sent if Command = Pose
2 Item ID UInt16 -
2 Stack UInt16 -
1 Prefix Byte -

Request TileEntity Interaction [122]

Client <-> Server

Size Description Type Notes
4 TileEntityID Int32 -
1 Player ID Byte -

Weapons Rack Try Placing [123]

Client -> Server

Size Description Type Notes
2 X Int16 -
2 Y Int16 -
2 Net ID Int16 -
1 Prefix Byte -
2 Stack Int16 -

TileEntity Hat Rack Item Sync [124]

Client <-> Server

Size Description Type Notes
1 Player ID Byte -
4 TileEntityID Int32 -
1 Item Index Byte -
2 Item ID UInt16 -
2 Stack UInt16 -
1 Prefix Byte -

Sync Tile Picking [125]

Client <-> Server

Size Description Type Notes
1 Player ID Byte -
2 X Int16 -
2 Y Int16 -
1 Pick Damage Byte -

Sync Revenge Marker [126]

Server -> Client

Size Description Type Notes
4 Unique ID Int32 -
4 X Single -
4 Y Single -
4 NPC ID Int32 -
4 NPC HP Percent Single -
4 NPC Type Int32 -
4 NPC AI Style Int32 -
4 Coin Value Int32 -
4 Base Value Single -
1 SpawnedFromStatue Boolean -

Remove Revenge Marker [127]

Server -> Client

Size Description Type Notes
4 Unique ID Int32 -

Land Golf Ball In Cup [128]

Client <-> Server

Size Description Type Notes
1 Player ID Byte -
2 X UInt16 -
2 Y UInt16 -
2 Number of Hits UInt16 -
2 Proj ID UInt16 -

Finished Connecting To Server [129]

Server -> Client

Size Description Type Notes

Fish Out NPC [130]

Client -> Server

Size Description Type Notes
2 X UInt16 -
2 Y UInt16 -
2 NPC ID Int16 -

Tamper With NPC [131]

Server -> Client

Size Description Type Notes
2 NPC ID UInt16 -
1 SetNPCImmunity Byte -
4 Immunity Time Int32 Only sent if SetNPCImmunity flag is true
2 Immunity Player ID Int16 Set to -1 for immunity from all players

Play Legacy Sound [132]

Server -> Client

Size Description Type Notes
4 X Single -
4 Y Single -
2 Legacy Sound ID UInt16 -
1 Sound Flags Byte BitFlags: 1 = New Sound Style, 2 = New Sound Volume, 3 = New Sound Pitch Offset
4 Sound Style Int32 Only sent if New Sound Style is true
4 Sound Volume Single Only sent if New Sound Volume is true
4 Sound Pitch Offset Single Only sent if New Sound Pitch Offset is true

Food Platter Try Placing [133]

Client -> Server

Size Description Type Notes
2 X Int16 -
2 Y Int16 -
2 Item ID Int16 -
1 Prefix Byte -
2 Stack Int16 -

Update Player Luck Factors [134]

Client <-> Server

Size Description Type Notes
1 Player ID Byte -
4 Ladybug Luck Time Remaining Int32 -
4 Torch Luck Single -
1 Luck Potion Byte -
1 Has Garden Gnome Nearby Boolean -
1 Broken Mirror Bad Luck Boolean -
4 Equipment-Based Luck Bonus Single -
4 Coin Luck Single -
1 Kite Luck Level Byte -

Dead Player [135]

Server -> Client

Size Description Type Notes
1 Player ID Byte -

Sync Cavern Monster Type [136]

Client <-> Server

Size Description Type Notes
2 Net ID UInt16 NPC.cavernMonsterType[0,0]
2 Net ID UInt16 NPC.cavernMonsterType[0,1]
2 Net ID UInt16 NPC.cavernMonsterType[0,2]
2 Net ID UInt16 NPC.cavernMonsterType[1,0]
2 Net ID UInt16 NPC.cavernMonsterType[1,1]
2 Net ID UInt16 NPC.cavernMonsterType[1,2]

Request NPC Buff Removal [137]

Client -> Server

Size Description Type Notes
2 NPC ID Int16 -
2 Buff ID UInt16 -

Client Finished Inventory Changes On This Tick [138]

Client -> Server

Size Description Type Notes

Sent by the client code in TrySyncingMyPlayer twice when a player moves an item around in their inventory. Packet actually has no data. Total payload size is 2 packets per inventory item drag, with 3 bytes each (2 for length, 1 for packet ID). This is a functionally useless packet.

Set CountsAsHostForGameplay [139]

Server -> Client

Size Description Type Notes
1 Player ID Byte -
1 countsAsHostForGameplay Boolean -

Set Misc Event Values [140]

Server -> Client

Size Description Type Notes
1 Event Type Byte 0 = Credits Roll Event, 1 = Transform Copper Slime, 2 = Transform Elder Slime
4 Event Data Int32 Remaining time for Credits Roll Event; NPC ID for Transform Copper/Elder Slime events

Request Lucy Popup [141]

Client <-> Server

Size Description Type Notes
1 Message Source Byte 0 = Idle, 1 = Storage, 2 = ThrownAway, 3 = PixedUp, 4 = ChoppedTree, 5 = ChoppedGemTree, 6 = ChoppedCactus, 7 = Count
1 Variation Byte -
4 Velocity X Single -
4 Velocity Y Single -
4 Position X Int32 -
4 Position Y Int32 -

Sync Projectile Trackers [142]

Client <-> Server

Size Description Type Notes
1 Player ID Byte -
2 Flying Piggy Bank Owner ID Int16 -
2 Flying Piggy Bank Expected Identity Int16 Only if Owner ID != -1
2 Flying Piggy Bank Expected Type Int16 Only if Owner ID != -1
2 Void Lens Owner ID Int16 -
2 Void Lens Expected Identity Int16 Only if Owner ID != -1
2 Void Lens Expected Type Int16 Only if Owner ID != -1

Crystal Invasion Requested To Skip Wait Time [143]

Client -> Server

Size Description Type Notes

Request Quest Effect [144]

Client -> Server

Size Description Type Notes

Sync Items With Shimmer [145]

Server <-> Client (Sync)

Size Description Type Notes
2 Item ID Int16 If below 400 and NetID 0 Then Set NullIf ItemID is 400 Then New Item
4 Position X Single -
4 Position Y Single -
4 Velocity X Single -
4 Velocity Y Single -
2 Stack Int16 -
1 Prefix Byte -
1 NoDelay Byte If 0 then ownIgnore = 0 and ownTime = 100
2 Item Net ID Int16 -
1 Shimmered Boolean -
4 Shimmer Time Single -

Shimmer Actions [146]

Server <-> Client (Sync)

Size Description Type Notes
1 Action Type Byte 0 = Shimmer, 1 = Coin Luck
4 Shimmer Position X Single Only sent if Action Type = Shimmer
4 Shimmer Position Y Single Only sent if Action Type = Shimmer
4 Coin Position X Single Only sent if Action Type = Coin Luck
4 Coin Position Y Single Only sent if Action Type = Coin Luck
4 Coin Amount Int32 Only sent if Action Type = Coin Luck

Sync Loadout [147]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
1 Loadout Index Byte -
2 Accessory Visibility UInt16 Bitwise array for player.hideVisibileAccessory[10]

Sync Item Cannot Be Taken By Enemies [148]

Server <-> Client (Sync)

Size Description Type Notes
2 Item ID Int16 If below 400 and NetID 0 Then Set NullIf ItemID is 400 Then New Item
4 Position X Single -
4 Position Y Single -
4 Velocity X Single -
4 Velocity Y Single -
2 Stack Int16 -
1 Prefix Byte -
1 NoDelay Byte If 0 then ownIgnore = 0 and ownTime = 100
2 Item Net ID Int16 -
1 timeLeftInWhichTheItemCannotBeTakenByEnemies Byte -

TE Dead Cells Display Jar [149]

Client -> Server

Size Description Type Notes
2 X Int16 -
2 Y Int16 -
2 Type Int16 -
1 Prefix Byte -
2 Stack Int16 -

Spectate Player [150]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
2 Target Player ID Int16 -

Sync Item Despawn [151]

Server <-> Client (Sync)

Size Description Type Notes
2 Item Index Int16 -

Item Use Sound [152]

Server <-> Client

Size Description Type Notes
1 Player ID Byte -

NPC Hurt By Debuff [153]

Server <-> Client (Sync)

Size Description Type Notes
1 NPC ID Byte -
2 Amount Int16 -

Ping [154]

Server <-> Client

Size Description Type Notes

Sync Chest Size [155]

Server <-> Client (Sync)

Size Description Type Notes
2 Chest ID Int16 -
2 New Size Int16 0 < New Size < 8000

TE Leashed Entity Anchor Place Item [156]

Client -> Server

Size Description Type Notes
2 Point X Int16 -
2 Point Y Int16 -
2 Item Type Int16 -

Team Change From UI [157]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
1 Team Byte -

Extra Spawn Section Loaded [158]

Server -> Client

Size Description Type Notes
1 Player ID Byte -

Request Section [159]

Client -> Server

Size Description Type Notes
2 Section X UInt16 -
2 Section Y UInt16 -

Sync Item Position [160]

Server -> Client

Size Description Type Notes
2 Item Index Int16 -
4 Position X Single -
4 Position Y Single -

Host Token [161]

Client -> Server

Size Description Type Notes
? Host Token String -

Appendix

Color Structure

Size Description Type Notes
1 Red Byte -
1 Green Byte -
1 Blue Byte -

Tile Structure

Size Description Type Notes
1 Tile Flags 1 Byte BitFlags: 1= Active, 4 = HasWall, 8 = HasLiquid, 16 = Wire1, 32 = HalfBrick, 64 = Actuator, 128 = Inactive
1 Tile Flags 2 Byte BitFlags: 1 = Wire2, 2 = Wire3, 4 = HasColor, 8 = HasWallColor, 16 = Slope1, 32 = Slope2, 64 = Slope3, 128 = Wire4
1 Tile Flags 3 Byte BitFlags: 1 = Fullbright Block, 2 = Fullbright Wall, 4 = Invisible Block, 8 = Invisible Wall
1 Color Byte Only if HasColor
1 Wall Color Byte Only if HasWallColor
2 Type UInt16 Only if Active
2 FrameX Int16 Only if Active && tileFrameImportant
2 FrameY Int16 Only if Active && tileFrameImportant
1 Wall UInt16 Only if HasWall
1 Liquid Byte Only if HasLiquid
1 LiquidType Byte Only if HasLiquid

Chest Structure

Size Description Type Notes
2 Index Int16 -
2 X Int16 -
2 Y Int16 -
? Chest Name String -

Sign Structure

Size Description Type Notes
2 Index Int16 -
2 X Int16 -
2 Y Int16 -
? Sign Text String -

TileEntity Structure

Size Description Type Notes
1 Type Byte 0 = Training Dummy, 1 = Item Frame, 2 = Logic Sensor, 3 = Display Doll, 4 = Weapons Rack, 5 = Hat Rack, 6 = Food Platter, 7 = Teleportation Pylon
4 ID Int32 -
2 X Int16 -
2 Y Int16 -
? ExtraData Variable See TE types below.

TrainingDummy ExtraData

Size Description Type Notes
2 NPC Index Int16 -

ItemFrame ExtraData

Size Description Type Notes
2 Item Type Int16 -
1 Item Prefix Byte -
2 Item Stack Int16 -

LogicSensor ExtraData

Size Description Type Notes
1 LogicCheckType Byte -
1 On Bool -

DisplayDoll ExtraData

Size Description Type Notes
1 Item Flags 1 Byte BitFlags: 0-8 items in "equip" category
1 Item Flags 2 Byte BitFlags: 0-8 items in "dyes" category
1 Pose Byte -
1 Item Flags 3 Byte BitFlags: 1 = "misc" item, 2 = 9th item in "equip" category, 4 = 9th item in "dyes" category
2 Item Type Int16 See note
1 Item Prefix Byte See note
2 Item Stack Int16 See note
2 Dye Type Int16 See note
1 Dye Prefix Byte See note
2 Dye Stack Int16 See note
2 Misc Item Type Int16 See note
1 Misc Item Prefix Byte See note
2 Misc Item Stack Int16 See note

Note: Each bit in Item Flags represents the presence of one item on the doll. It will loop through each item in the "equip" category, then the "dyes" category, then the "misc" category, reading the type, prefix, and stack for each corresponding item.

WeaponsRack ExtraData

Size Description Type Notes
2 Item Type Int16 -
1 Item Prefix Byte -
2 Item Stack Int16 -

HatRack ExtraData

Size Description Type Notes
1 HatFlags Byte BitFlags: 0-2 items
2 Item Type Int16 See note
1 Item Prefix Byte See note
2 Item Stack Int16 See note
2 Dye Type Int16 See note
1 Dye Prefix Byte See note
2 Dye Stack Int16 See note

Note: Each bit in HatFlags represents the presence of one item on the hat rack. For each item, it will loop through and read the item type, prefix, and stack. Then it will move on to the dyes and read the type, prefix, and stack for the dye items.

FoodPlatter ExtraData

Size Description Type Notes
2 Item Type Int16 -
1 Item Prefix Byte -
2 Item Stack Int16 -

TeleportationPylon ExtraData

No extra data for TeleportationPylon.

Size Description Type Notes

DeadCellsDisplayJar ExtraData

Size Description Type Notes
2 Item Type Int16 -
1 Item Prefix Byte -
2 Item Stack Int16 -

KiteAnchor ExtraData

No extra data for KiteAnchor.

Size Description Type Notes

CrittorAnchor ExtraData

No extra data for CrittorAnchor.

Size Description Type Notes

PlayerDeathReason

Size Description Type Notes
1 Player Death Reason Byte BitFlags: 1 = Killed via PvP, 2 = Killed via NPC, 4 = Killed via Projectile, 8 = Killed via Other, 16 = Killed via Projectile, 32 = Killed via PvP, 64 = Killed via PvP, 128 = Killed via Custom Modification
2 Killer's Player ID Int16 Only if BitFlags[0] is true
2 Killing NPC's Index Int16 Only if BitFlags[1] is true
2 Projectile Index Int16 Only if BitFlags[2] is true
1 Type of Death (Other) Byte Only if BitFlags[3] is true: 0 = Fall Damage, 1 = Drowning, 2 = Lava Damage, 3 = Fall Damage, 4 = Demon Altar, 6 = Companion Cube, 7 = Suffocation, 8 = Burning, 9 = Poison/Venom, 10 = Electrified, 11 = WoF (Escape), 12 = WoF (Licked), 13 = Chaos State, 14 = Chaos State v2 (Male), 15 = Chaos State v2 (Female)
2 Projectile Type Int16 Only if BitFlags[4] is true
2 Item Type Int16 Only if BitFlags[5] is true
1 Item Prefix Byte Only if BitFlags[6] is true
? Death Reason String Only if BitFlags[7] is true

NetworkText

Size Description Type Notes
1 Mode Byte Enum: 0 = Literal, 1 = Formattable, 2 = LocalizationKey
? Text String -
1 SubstitutionList Length Byte Only if Mode != Literal
? SubstitutionList NetworkText[] Only if Mode != Literal

ParticleOrchestraSettings

Size Description Type Notes
8 Position Vector2 -
8 Movement Vector Vector2 -
4 Unique Info Piece Int32 Data varies based on type of particle spawn
1 Invoking Player ID Byte -

Net Modules

Net Module Format (packet within a packet)

Offset Size Description Type Notes
0 2 Packet length in bytes UInt16 -
2 1 Packet Type/ID UInt8 Use TSAPI's Packetypes.PacketName enum for packet ID's
3 2 Net Module ID/Type UInt16 -
5 ? Net Module Data ? -

Liquid [0]

Server -> Client

Size Description Type Notes
2 Total changes UInt16 Number of times the following has been repeated.
4 Position Int32 Y is the first 2 bytes, X is the last 2 bytes.
1 Liquid Amount Byte 0-255
1 Liquid Type Byte 0 = Water, 1 = Lava, 2 = Honey

Text [1]

Client -> Server

Size Description Type Notes
? Chat Command ID String -
? Chat Message String -

Server -> Client

Size Description Type Notes
1 Author Index Byte Only 0-254 shows chat above heads. Not sent by client, client's index is used for id.
? Message Text NetworkText -
3 Color Color -

Ping [2]

Server <-> Client (Sync)

Size Description Type Notes
8 Position Vector2 -

Ambience [3]

Server -> Client

Size Description Type Notes
1 Player ID Byte Player the effect centers around
4 Seed Int32 Seed for FastRandom
1 SkyEntity Type Byte 0 = BirdsV, 1 = Wyvern, 2 = Airship, 3 = AirBalloon, 4 = Eyeball, 5 = Meteor, 6 = BoneSerpent, 7 = Bats, 8 = Butterflies, 9 = LostKite, 10 = Vulture, 11 = PixiePosse, 12 = Seagulls, 13 = SlimeBalloons, 14 = Gastropods, 15 = Pegasus, 16 = EaterOfSouls, 17 = Crimera, 18 = Hellbats

Bestiary [4]

Server -> Client

Size Description Type Notes
1 BestiaryUnlockType Byte 0 = Kill, 1 = Sight, 2 = Chat
2 NPC NetID Int16 -
2 Kill Count Byte * 2 (7 Bit Encoded Int) Only included if BestiaryUnlockType is Kill

CreativePowers [5]

Server <-> Client (Sync)

Size Description Type Notes
2 Power Type UInt16 0 = FreezeTime, 1 = StartDayImmediately, 2 = StartNoonImmediately, 3 = StartNightImmediately, 4 = StartMidnightImmediately, 5 = GodmodePower, 6 = ModifyWindDirectionAndStrength, 7 = ModifyRainPower, 8 = ModifyTimeRate, 9 = FreezeRainPower, 10 = FreezeWindDirectionAndStrength, 11 = FarPlacementRangePower, 12 = DifficultySliderPower, 13 = StopBiomeSpreadPower, 14 = SpawnRateSliderPerPlayerPower

Note: There are permission checks in place, but all powers only use CanBeChangedByEveryone so they all pass unless a plugin changes this.

namespace Terraria.GameContent.Creative
{
	public enum PowerPermissionLevel
	{
		LockedForEveryone,       //0 Will always reject
		CanBeChangedByHostAlone, //1 Will only accept if on singleplayer (Main.netMode = 0)
		CanBeChangedByEveryone   //2 Default value for all
	}
}

CreativeUnlocksPlayerReport [6]

Client -> Server

Size Description Type Notes
1 Player ID Byte -
2 Item ID UInt16 -
2 Sacrificed/Researched Item Amount UInt16 -

TeleportPylon [7]

Server <-> Client (Sync)

Size Description Type Notes
1 Pylon Packet Type Byte 0 = PylonWasAdded, 1 = PylonWasRemoved, 2 = PlayerRequestsTeleport
2 Position X Int16 -
2 Position Y Int16 -
1 Pylon Type Byte 0 = SurfacePurity, 1 = Jungle, 2 = Hallow, 3 = Underground, 4 = Beach, 5 = Desert, 6 = Snow, 7 = GlowingMushroom, 8 = Victory (Universal Pylon), 9 = Underworld, 10 = Shimmer

Particles [8]

Server <-> Client (Sync)

Size Description Type Notes
1 Particle Type Byte 69 Types Available
21 ParticleOrchestraSettings ParticleOrchestraSettings -

CreativePowerPermissions [9]

Server -> Client

Size Description Type Notes
1 0 Byte Always zero, value here maybe intended for other potential unlock reports. Within NetCreativePowerPermissionsModule, private const _setPermissionLevelId = 0
2 Power Type UInt16 0 = FreezeTime, 1 = StartDayImmediately, 2 = StartNoonImmediately, 3 = StartNightImmediately, 4 = StartMidnightImmediately, 5 = GodmodePower, 6 = ModifyWindDirectionAndStrength, 7 = ModifyRainPower, 8 = ModifyTimeRate, 9 = FreezeRainPower, 10 = FreezeWindDirectionAndStrength, 11 = FarPlacementRangePower, 12 = DifficultySliderPower, 13 = StopBiomeSpreadPower, 14 = SpawnRateSliderPerPlayerPower
1 Power Level Byte 0 = LockedForEveryone, 1 = CanBeChangedByHostAlone, 2 = CanBeChangedByEveryone

Note: All powers use only CanBeChangedByEveryone. If the server tells the client a power has a permission other than default, it will be stopped client-side and notified in the client's localization.

Banners [10]

Size Description Type Notes
1 Message Type Byte 0 = FullState, 1 = KillCountUpdate, 2 = ClaimCountUpdate, 3 = ClaimRequest, 4 = ClaimResponse
2 Kill Count Length Int16 Only sent if MessageType = FullState
4 * KillCountLength Kill Count Amount Int32 * KillCountLength Only sent if MessageType = FullState; loops through KillCountLength times to get Kill Count Amount for each position
2 Claimable Banners Length Int16 Only sent if MessageType = FullState
2 * Claimable Banners Length Claimable Banners Amount UInt16 * Claimable Banners Length Only sent if MessageType = FullState; loops through Claimable Banners Length times to get Claimable Banners Amount for each position
2 Kill Count Index Int16 Only sent if MessageType = KillCountUpdate
4 Kill Count Amount Int32 Only sent if MessageType = KillCountUpdate
2 Claimable Banners Index Int16 Only sent if MessageType = ClaimCountUpdate, ClaimRequest, or ClaimResponse
2 Claimable Banners Amount UInt16 Only sent if MessageType = ClaimCountUpdate, ClaimRequest, or ClaimResponse
1 Claim Granted Boolean Only sent if MessageType = ClaimResponse

Note: FullState, KillCountUpdate, ClaimCountUpdate, and ClaimResponse are Server -> Client only.

Crafting Requests [11]

Client -> Server (Request)

Size Description Type Notes
2 Number of Required Items Byte * 2 (7 Bit Encoded Int) -
4 Item ID or Recipe Group Int32 Loops through Number of Required Items
2 Stack Byte * 2 (7 Bit Encoded Int) Loops through Number of Required Items
2 Number of Chests Byte * 2 (7 Bit Encoded Int) -
2 Chest Index Byte * 2 (7 Bit Encoded Int) Loops through Number of Chests

Server -> Client (Response)

Size Description Type Notes
1 Approval Boolean -

Tag Effect State [12]

Server <-> Client (Sync)

Size Description Type Notes
1 Player ID Byte -
1 Message Type Byte 0 = FullState, 1 = ChangeActiveEffect, 2 = ApplyTagToNPC, 3 = EnableProcOnNPC, 4 = ClearProcOnNPC
2 Active Effect Type Int16 Only sent if MessgeType = FullState or ChangeActiveEffect
1 NPC Time Index Byte Only sent if MessgeType = FullState; Loops through TimeLeftOnNPC array
4 Time Left On NPC Int32 Only sent if MessgeType = FullState; Loops through TimeLeftOnNPC array
1 Proc Time Left on NPC Index Byte Only sent if MessgeType = FullState and effect includes SyncProcs; Loops through ProcTimeLeftOnNPC array
4 Proc Time Left on NPC Int32 Only sent if MessgeType = FullState and effect includes SyncProcs; Loops through ProcTimeLeftOnNPC array
1 NPC Index Byte Only sent if MessageType = ApplyTagToNPC, EnableProcOnNPC, or ClearProcOnNPC

Leashed Entity Module [13]

Server <-> Client (Sync)

Size Description Type Notes
1 Message Type Byte 0 = Remove, 1 = FullSync, 2 = PartialSync
2 Slot Byte * 2 (7 Bit Encoded Int) -
2 Type Byte * 2 (7 Bit Encoded Int) Only sent if MessageType = FullSync
2 Anchor POS X Int16 Only sent if MessageType = FullSync
2 Anchor POS Y Int16 Only sent if MessageType = FullSync
? Leashed Entity Data Variable See below.

Leashed Kite

Size Description Type Notes
2 Proj Type Byte * 2 (7 Bit Encoded Int) Only sent if Module Message Type = FullSync
4 Position X Single -
4 Position Y Single -
4 UInt32 (PackedVector) Two Int16's packed into 4 bytes.
1 Rotation Byte -
4 Wind Target Single -
4 Cloud Alpha Single -
4 Time Counter Single -

Leashed Critter

Walker, Crawler, Snail, Runner, Flyer, Normal Butterfly, Empress Butterfly, Hell Butterfly, Firefly, Shimmer Fly, Dragonfly, Crawling Fly, Bird, Waterfowl, Fish, Fairy, Jumper, Water Strider

Size Description Type Notes
2 NPC Type Byte * 2 (7 Bit Encoded Int) Only sent if Module Message Type = FullSync
4 Size X Single Only sent if Module Message Type = FullSync
4 Size Y Single Only sent if Module Message Type = FullSync
4 Position Offset UInt32 (PackedVector) Two Int16's packed into 4 bytes.
1 Direction Boolean -1 or 1
4 Rand State UInt32 -
2 Wait Time Int16 -
1 State Byte -
1 Target Position Offset X SByte -
1 Target Position Offset Y SByte -

Unbreakable Wall Scan [14]

Server -> Client

Size Description Type Notes
1 Player ID Byte -
1 Inside Unbreakable Walls Boolean -
⚠️ **GitHub.com Fallback** ⚠️