Skip to main content

Module entity

Module entity 

Source
Expand description

This module contains entity-related traits and types.

Re-exportsΒ§

pub use projectile::AbstractThrownPotion;
pub use projectile::EntityHitResult;
pub use projectile::Projectile;
pub use projectile::ProjectileBase;
pub use projectile::ProjectileDeflection;
pub use projectile::ProjectileEventSource;
pub use projectile::ProjectileHit;
pub use projectile::SPLASH_HORIZONTAL_REACH;
pub use projectile::SPLASH_RANGE_SQ;
pub use projectile::SPLASH_VERTICAL_REACH;
pub use projectile::ThrowableItemProjectile;
pub use projectile::ThrowableProjectile;
pub use projectile::ViewVectorHitResult;
pub use projectile::compute_margin;
pub use projectile::get_hit_result_on_view_vector;
pub use projectile::spawn_throwable_item_projectile;

ModulesΒ§

ageable πŸ”’
Shared vanilla AgeableMob state and hooks.
ai πŸ”’
Vanilla-shaped mob AI foundations.
animal πŸ”’
Shared vanilla Animal state and hooks.
attribute
Runtime entity attribute system.
base πŸ”’
Common base functionality shared by all entities.
block_attached_entity πŸ”’
Shared Vanilla BlockAttachedEntity state and hooks.
block_effects πŸ”’
callback πŸ”’
Entity lifecycle callbacks for movement and removal tracking.
combat_rules πŸ”’
consume_effect
Consume-effect behaviors: one small module per vanilla ConsumeEffect subtype under net/minecraft/world/item/consume_effects.
conversion πŸ”’
damage
Exact damage attribution and server-owned recent damage history.
dismount_helper πŸ”’
Vanilla dismount location helper
entities
Concrete entity implementations.
entity πŸ”’
entity_manager_benchmark_support
Fixtures for benchmarking the world entity manager without a live world.
entity_selector
Shared entity predicates.
fluid_contact πŸ”’
Entity contact with world fluids.
generated_entities πŸ”’
Generated entity factory and spawn rule registrations.
identity πŸ”’
inside_block_effects πŸ”’
item_based_steering πŸ”’
Vanilla item-steered vehicle helpers.
item_frame πŸ”’
Shared item-frame entity behavior.
leash πŸ”’
living_base πŸ”’
Shared fields for all living entities.
living_entity πŸ”’
living_reference πŸ”’
manager πŸ”’
World-level entity ownership and lookup.
mob πŸ”’
Vanilla-shaped mob foundations.
mob_effect
Mob-effect behaviors: one small module per vanilla MobEffect subtype under net/minecraft/world/effect.
monster πŸ”’
Shared hostile-mob markers, behavior, and spawn rules.
movement_sync πŸ”’
Shared movement synchronization state for tracked entities.
potion_contents πŸ”’
Vanilla PotionContents behavior extension: the methods that need LivingEntity/World, which can’t live alongside the data in steel_registry::data_components::PotionContents.
projectile
Vanilla Projectile class hierarchy, mirrored as Rust traits + base structs.
pushing πŸ”’
Entity pushing, with a batched fast path that keeps vanilla’s contact order.
reference πŸ”’
registry πŸ”’
Entity registry for creating entity instances.
selector πŸ”’
Entity selection predicates shared by queries, after vanilla EntitySelector.
spawn πŸ”’
spawn_placements πŸ”’
Entity-type spawn placement dispatch.
storage πŸ”’
Proto-chunk entity storage.
synced_data πŸ”’
ticking πŸ”’
Shared vanilla entity tick helpers.
tracker πŸ”’
Entity tracking system for managing which players can see which entities.

StructsΒ§

AcceptedClientMovement
Final state accepted from a client-authored movement packet.
ActiveItemUseState
Vanilla active item-use state stored on LivingEntity.
BlockEffectFireSnapshot πŸ”’
ChunkEntityLoadResult
Entity changes produced when a chunk becomes loaded.
ConversionParams
Controls which state a converted mob inherits.
EntityAmethystStepSound
Sound parameters for vanilla amethyst step chimes.
EntityBase
Common fields and methods shared by all entities.
EntityBaseLoad
Base fields restored from persistent entity data.
EntityBaseSaveData
Shared vanilla entity save data that is not part of the movement snapshot.
EntityBaseState
Vanilla Entity movement state stored as one locked snapshot.
EntityChangeSenders
Packet sinks used by EntityTracker::send_changes.
EntityChunkCallback
Callback attached to each entity for tracking chunk/section movement.
EntityFireFreezeState
Vanilla base fire and freezing state.
EntityFluidContact
Fluid heights intersecting an entity’s current bounding box.
EntityGeneration
Opaque generation counter for one runtime construction of an entity.
EntityGroundContact
Vanilla ground-support state updated by Entity.checkSupportingBlock.
EntityLifecycleChanges
Entity lifecycle changes caused by manager membership or visibility updates.
EntityLoadRequest
Entity load request before the registry assigns a runtime ID.
EntityMoveUpdate
Section/chunk membership update caused by a committed entity move.
EntityMovement
A vanilla movement segment used by block-contact effects.
EntityMovementFlags
Vanilla collision and ground-contact flags updated by Entity.move.
EntityMovementProgress
Vanilla movement distance counters used by step, swim, and flap side effects.
EntityMovementSyncPackets
At most two movement packets are emitted for one tracked movement update: one body movement/rotation packet and one head-rotation packet.
EntityMovementSyncState
Per-entity movement sync state for tracked position and rotation.
EntityMovementSyncUpdate
Runtime values accepted by tracked entity movement sync.
EntityPositionSyncSnapshot
Runtime values needed to build a vanilla position sync packet.
EntityPositionSyncState
Per-entity position sync state shared by player and entity tracking.
EntityPushSnapshot
Saved inputs for one push contact.
EntityReference
A UUID reference that re-resolves removed entities within the same domain.
EntityRegistry
Registry for entity factories and spawn rules.
EntityRotationSyncState
Last packed rotation values known to tracking clients.
EntityTracker
World-level entity tracker.
EntityVelocitySyncState
Per-entity velocity sync state for tracked entities.
InactiveEntityCallback
Callback for entities retained outside live world membership.
InsideBlockEffectCollector
Step-scoped collector for vanilla inside-block side effects.
LivingEntityBase
Common runtime fields shared by all living entities.
LivingEntityRef
A living entity capability tied to the same shared allocation used for attribution.
LivingRotationState
Vanilla living-entity body/head rotation state.
LivingSwingState
Arm-swing animation state stored on a living entity.
LivingTravelInput
Movement input stored on vanilla LivingEntity.
MobEffectInstance
Runtime mob-effect state.
NullEntityCallback
Null callback for entities not yet in the world.
PackedEntityRotation
Packed body rotation used by entity movement packets.
PendingWorldChangeToken
Runtime token for an in-flight world change request.
PlayerEntityCallback
Callback for players.
ServerEntityMovementSyncState
Per-tracked-entity movement state owned by the entity tracker.
ServerEntityMovementSyncUpdate
Runtime values accepted by vanilla ServerEntity.sendChanges movement sync.
SwimmingEnvironment πŸ”’
WorldEntityManager
Central world entity manager.

EnumsΒ§

AcceptedClientMovementOutcome
Result of applying accepted client-authored movement.
AddEntityError
Error returned when adding an entity to the runtime world fails.
BlockEffectSegmentResult πŸ”’
ConversionType
How conversion handles the source mob.
EntityAnchor
The point on an entity used by commands that resolve positions or facing.
EntityMoveError
Error returned when a live entity move cannot be committed.
EntityMovementEmission
Vanilla movement side effects emitted by Entity.move.
EntityMovementSyncPacket
Concrete movement sync packet ready for broadcast.
EntityOwnership
Whether the manager owns persistence for an entity.
EntityPositionRotSyncPacket
Position sync packet for entities that include rotation in delta updates.
EntityPositionSyncDecision
Encoded position sync selected for an entity movement update.
EntityPositionSyncPacket
Position sync packet for entities that do not include rotation in delta updates.
EntityVerticalMovementStateUpdate
Vanilla server-driven gate for vertical collision and ground-contact updates.
EntityVisibility
Entity visibility for a chunk column.
InsideBlockEffectType
Vanilla inside-block effect kinds applied after entity/block intersections.
MobEffectSyncChange
A queued mob-effect packet change produced by living effect state.
MobEffectSyncPacket
Concrete mob-effect packet ready to send to a player connection.
RemovalReason
Reasons an entity can be removed from the world.
TeleportPositionCommit πŸ”’

ConstantsΒ§

BUBBLE_COLUMN_ABOVE_DOWN_MIN_SPEED πŸ”’
BUBBLE_COLUMN_ABOVE_UP_ACCELERATION πŸ”’
BUBBLE_COLUMN_ABOVE_UP_MAX_SPEED πŸ”’
BUBBLE_COLUMN_DOWN_ACCELERATION πŸ”’
BUBBLE_COLUMN_INSIDE_DOWN_MIN_SPEED πŸ”’
BUBBLE_COLUMN_INSIDE_UP_ACCELERATION πŸ”’
BUBBLE_COLUMN_INSIDE_UP_MAX_SPEED πŸ”’
DAMAGE_KNOCKBACK_POWER πŸ”’
DEATH_DURATION
Duration in ticks of the death animation before entity removal.
DEFAULT_AIR_DRAG
The default air drag value for entities.
DEFAULT_MAX_AIR_SUPPLY
Default maximum air supply in ticks before an entity starts drowning.
DEFAULT_SWING_DURATION
Vanilla default SwingAnimation duration in ticks.
DEFAULT_TICKS_REQUIRED_TO_FREEZE
Default ticks of powder-snow exposure required before an entity starts taking freeze damage.
ENTITY_LOAD_MAX_HORIZONTAL_POSITION πŸ”’
ENTITY_LOAD_MAX_VERTICAL_POSITION πŸ”’
HURT_DURATION_TICKS
Duration in ticks of the vanilla hurt animation.
IN_WALL_EYE_BOX_HEIGHT πŸ”’
KNOCKBACK_DIRECTION_EPSILON_SQ πŸ”’
LEASH_SCAN_HALF_SIZE πŸ”’
LEASH_SCAN_SIZE πŸ”’
MAX_ENTITY_TAGS
Maximum number of scoreboard tags a single entity may carry.
MOVEMENT_RECORD_EPSILON πŸ”’
MOVE_TOWARDS_CLOSEST_SPACE_DIRECTIONS πŸ”’
NO_PHYSICS_COLLISION_EPSILON πŸ”’
POSITION_SYNC_THRESHOLD
Squared position delta needed before vanilla considers a movement worth syncing.
SPEED_MODIFIER_POWDER_SNOW_ID πŸ”’
WATER_ENTITY_FLOW_SCALE πŸ”’

StaticsΒ§

ENTITIES
Global entity registry.
ENTITY_COUNTER πŸ”’
Global counter for allocating unique entity IDs.

TraitsΒ§

DefaultEntityPush
Vanilla push and cramming behavior with no overrides. Implementors only read state, only write velocity and the velocity sync flag, and never re-enter the entity manager. Entities that override contact, velocity or cramming hooks must not opt in.
Entity
A trait for entities.
EntityEventSource
Object-safe access to an entity trait object from default Entity methods.
EntityLevelCallback
Callback interface for entity lifecycle events.
EntitySyncedData
Thread-safe access to an entity’s vanilla synchronized data.
ItemFrame
Vanilla ItemFrame behavior used by comparators.
LivingEntity
A trait for living entities that can take damage, heal, and die.
LivingEntitySyncedData
Thread-safe access to synchronized data declared by vanilla LivingEntity.

FunctionsΒ§

aabb_contains_any_liquid πŸ”’
apply_block_effect_segment πŸ”’
apply_effects_from_block_movements πŸ”’
apply_post_teleport_transition πŸ”’
apply_step_on_block πŸ”’
axis_component πŸ”’
block_state_suffocates_eye_box πŸ”’
change_entity_world πŸ”’
change_non_player_entity_world πŸ”’
clamp_loaded_entity_position πŸ”’
Clamps an entity position using vanilla’s load-time world-bound limits.
closest_open_space_direction πŸ”’
collided_with_fluid πŸ”’
direction_step πŸ”’
entity_eye_suffocation_box πŸ”’
entity_loot_ref πŸ”’
entity_type_name πŸ”’
equipment_items_to_packet_items πŸ”’
fall_damage_reset_clip_target πŸ”’
fall_flying_collision_damage πŸ”’
fall_flying_free_fall_interval πŸ”’
finish_inside_block_effects πŸ”’
get_input_vector πŸ”’
get_kill_credit πŸ”’
Returns the living entity that will be credited with killing this entity.
horizontal_distance πŸ”’
indirect_passengers πŸ”’
init_entities
Initializes the global entity registry, once the main registry is frozen.
leash_scan_area πŸ”’
leashables_leashed_to_holder_in_area_near_position
Finds the leashable mobs near a position whose holder is holder.
living_loot_equipment πŸ”’
Clones every equipment slot of entity so loot predicates can read it without holding the equipment lock while the table rolls.
loot_equipment πŸ”’
living_loot_equipment for any entity; None for non-living entities.
nbt_bool πŸ”’
next_entity_id
Allocates a new unique entity ID.
passenger_transition πŸ”’
passenger_transition_position πŸ”’
passenger_transition_rotation πŸ”’
physics_state_for_move πŸ”’
record_movement_for_block_effects πŸ”’
relative_on_axis πŸ”’
remove_after_changing_dimensions πŸ”’
remove_entity_name_actions πŸ”’
reset_forward_direction_of_relative_portal_position πŸ”’
select_swimming_state πŸ”’
send_teleport_transition_to_riding_players πŸ”’
should_apply_entity_cramming_damage πŸ”’
should_apply_resolved_movement πŸ”’
start_riding_entities πŸ”’
sync_dirty_mob_effects
Pushes newly dirty mob-effect state into a living entity’s synced data.
teleport_entity_cross_world πŸ”’
teleport_entity_same_world πŸ”’
teleport_set_position πŸ”’
transfer_leashables_to_holder πŸ”’
trapdoor_usable_as_ladder_state πŸ”’
world_aabb_center πŸ”’

Type AliasesΒ§

ActiveMobEffect
Active mob-effect state stored on a living entity.
AfterConversion
Finalizes a freshly converted mob.
InsideBlockEffectCallback
Callback queued around an inside-block effect.
SharedEntity
Shared ownership of an entity through its gameplay interface.
WeakEntity
Type alias for a weak entity reference.