Expand description
Terraria network wire format.
This crate is deliberately free of I/O so that every packet can be round-tripped in a unit test
without a socket. The async server lives in the terrustia crate.
Copyright (c) 2026 Brooklyn Halmstad. Licensed under the MIT licence; see the LICENSE file beside this crate’s manifest. The server that uses it is AGPL, but this crate is not: it is a description of a wire format, and holding that hostage to a licence would help nobody.
Re-exports§
pub use error::ProtoError;pub use error::Result;pub use item::ItemStack;pub use net_text::NetworkText;pub use net_text::TextMode;pub use reader::PacketReader;pub use section::SECTION_HEIGHT;pub use section::SECTION_WIDTH;pub use section::SectionBounds;pub use section::SectionExtras;pub use tile::Liquid;pub use tile::Tile;pub use tile::TileFlags;pub use writer::MAX_FRAME_LEN;pub use writer::PacketWriter;pub use writer::Writer;
Modules§
- angler
- The Angler’s daily quest, generated from the game’s own rules.
- banners
- Which enemies have a banner, and how many of them it takes to earn one.
- buffs
- Buff tables, generated from the game’s own.
- conditional_
drops - Loot that depends on more than the thing that died.
- convert
- Turning one biome into another, block by block.
- difficulty
- How a world’s difficulty and its player count change what an enemy is made of.
- error
- housing
- Housing rules for town NPCs, transcribed from
WorldGen.StartRoomCheck,CheckRoomandRoomNeedsin the 1.4.5.7 build. - hurt
- Hurting and killing players: packets
117(PlayerHurtV2) and118(PlayerDeathV2). - hurt_
tiles - Which tiles hurt to stand in, generated from the game’s own sets.
- id
- Numeric message ids, transcribed from
Terraria.ID.MessageIDin the 1.4.5.7 build. - inventory
- Player inventories — packet 5,
SyncEquipment. - item
- items
- Item entities lying in the world: packets
21,22and151. - locks
- Locked chests and doors, and what it takes to open one.
- net_
module - Packet
82carries a “net module” identified by a leadingu16. - net_
text - npc
- NPC networking: packets
23(SyncNPC),28(DamageNPC) and162(the damage acknowledgement). - npc_
data - Stats for every NPC type, transcribed from
NPC.SetDefaultsin the 1.4.5.7 build. - npc_
drops - What NPCs drop when they die, generated from
ItemDropDatabase. - npc_
params - Per-type parameters pulled out of the game’s AI routines.
- objects
- Packets for the interactive world objects: chests, signs and doors.
- orbs
- Shadow orbs and crimson hearts: what breaking one gives you.
- packets
- Typed packets for the connection handshake and player sync.
- placed_
items - Which item a placed object gives back when it is mined.
- player_
info - Decoding packet 4 (
SYNC_PLAYER,PlayerInfo): what a client says about how it looks. - prehardmode
- The pre-hardmode NPC roster.
- projectile
- Projectile networking: packets
27(SyncProjectile) and29(KillProjectile). - projectile_
data - Stats for every projectile the game defines, generated from
Projectile.SetDefaults. - reader
- recipes
- What crafted things are made of, generated from the game’s recipes.
- section
- Tile section coding — packet
10. - shimmer
- What shimmer turns things into, generated from the game’s own tables.
- square
- Packet
20,AreaTileChange— a small rectangle of tiles pushed as a unit. - statues
- What each statue does when a circuit reaches it.
- tile
- tile_
drops - Which item a tile drops when it is mined.
- tile_
entity - Tile entities: the furniture that remembers something.
- tile_
object - Multi-tile objects — how big each one is and how its frames are laid out.
- tile_
sets - Tile type property tables, transcribed from the 1.4.5.7 build.
- tile_
solid - Which tile types block movement.
- touch_
debuffs - What touching an enemy does to you beyond the damage.
- town_
names - The names town NPCs are given, generated from the game’s own lists.
- travel_
shop - The Travelling Merchant’s stock, generated from the game’s own chain.
- writer