Skip to main content

Module entity_data

Module entity_data 

Source
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

§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§

BlockPos
A block position.
DataValue
Network-ready data value with index and serializer info.
EntityDataSerializerEntry
Entry for a registered entity data serializer.
EntityDataSerializerRegistry
Registry of entity data serializers.
GlobalPos
A global position (dimension + block position).
ParticleData
Particle effect data.
ParticleList
A list of particle effects.
Quaternionf
A quaternion rotation (for display entities).
ResolvableProfile
Game profile for player heads and similar.
Rotations
Rotations for armor stands and similar entities (pitch, yaw, roll in degrees).
SyncedValue
Wrapper that tracks modifications per-field.
Vector3f
A 3D vector (for display entities).
VillagerData
Villager profession, type, and level data.

Enums§

ArmadilloState
Armadillo entity state.
Direction
The six cardinal directions in Minecraft.
EntityData
Type-erased entity data for network encoding.
EntityPose
Entity pose states.
HumanoidArm
Main hand preference (left or right).
ParticleOptions
Particle-specific payload written after the particle type id.
SnifferState
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§

EntityDataSerializerEntryRef
EntityDataWriter
Writer function for serializing entity data to network format.