Expand description
Entity data synchronization system.
This module provides the infrastructure for syncing entity state (health, pose, flags, etc.)
between server and client via the SetEntityData packet.
§Architecture
SyncedValue<T>- Wrapper that tracks per-field dirty stateEntityData- Type-erased enum for network serializationDataValue- Network-ready value with index and serializer infoEntityPose- Entity pose states (standing, sneaking, swimming, etc.)EntityDataSerializerRegistry- Registry of serializers with writers
§Serialization Flow
Serialization happens through the registry, not directly on EntityData:
ⓘ
let writer = REGISTRY.entity_data_serializers.get_writer(serializer_id).unwrap();
writer(&entity_data_value, &mut buf)?;§Generated Code
Per-entity data structs (e.g., PlayerEntityData) are generated by the build script
from entities.json and live in steel-registry/src/generated/entity_data.rs.
Modules§
- serializer 🔒
- Entity data serializer registry.
- vanilla_
serializers 🔒 - Vanilla entity data serializer registration.
Structs§
- Block
Pos - A block position.
- Data
Value - Network-ready data value with index and serializer info.
- Entity
Data Serializer Entry - Entry for a registered entity data serializer.
- Entity
Data Serializer Registry - Registry of entity data serializers.
- Global
Pos - A global position (dimension + block position).
- Particle
Data - Particle effect data.
- Particle
List - A list of particle effects.
- Quaternionf
- A quaternion rotation (for display entities).
- Resolvable
Profile - Game profile for player heads and similar.
- Rotations
- Rotations for armor stands and similar entities (pitch, yaw, roll in degrees).
- Synced
Value - Wrapper that tracks modifications per-field.
- Vector3f
- A 3D vector (for display entities).
- Villager
Data - Villager profession, type, and level data.
Enums§
- Armadillo
State - Armadillo entity state.
- Direction
- The six cardinal directions in Minecraft.
- Entity
Data - Type-erased entity data for network encoding.
- Entity
Pose - Entity pose states.
- Humanoid
Arm - Main hand preference (left or right).
- Particle
Options - Particle-specific payload written after the particle type id.
- Sniffer
State - Sniffer entity state.
Functions§
- register_
vanilla_ entity_ data_ serializers - Register all vanilla entity data serializers.
- write_
data_ values - Write a list of data values to a buffer, with the 0xFF terminator.
Type Aliases§
- Entity
Data Serializer Entry Ref - Entity
Data Writer - Writer function for serializing entity data to network format.