Expand description
This module contains entity-related traits and types.
Re-exportsΒ§
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::ThrowableItemProjectile;pub use projectile::ThrowableProjectile;pub use projectile::compute_margin;
ModulesΒ§
- ageable π
- Shared vanilla
AgeableMobstate and hooks. - ai π
- Vanilla-shaped mob AI foundations.
- animal π
- Shared vanilla
Animalstate and hooks. - attribute
- Runtime entity attribute system.
- base π
- Common base functionality shared by all entities.
- block_
effects π - callback π
- Entity lifecycle callbacks for movement and removal tracking.
- combat_
rules π - damage
- Damage source system.
- entities
- Concrete entity implementations.
- entity π
- fluid_
contact π - Entity contact with world fluids.
- generated_
entities π - Generated entity factory registrations.
- inside_
block_ πeffects - item_
based_ πsteering - Vanilla item-steered vehicle helpers.
- item_
frame π - Shared item-frame entity behavior.
- living_
base π - Shared fields for all living entities.
- living_
entity π - manager π
- World-level entity ownership and lookup.
- mob π
- Vanilla-shaped mob foundations.
- movement_
sync π - Shared movement synchronization state for tracked entities.
- projectile
- Vanilla
Projectileclass hierarchy, mirrored as Rust traits + base structs. - registry π
- Entity registry for creating entity instances.
- spawn π
- 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Β§
- Accepted
Client Movement - Final state accepted from a client-authored movement packet.
- Block
Effect πFire Snapshot - Chunk
Entity Load Result - Entity changes produced when a chunk becomes loaded.
- Entity
Amethyst Step Sound - Sound parameters for vanilla amethyst step chimes.
- Entity
Base - Common fields and methods shared by all entities.
- Entity
Base Load - Base fields restored from persistent entity data.
- Entity
Base Save Data - Shared vanilla entity save data that is not part of the movement snapshot.
- Entity
Base State - Vanilla
Entitymovement state stored as one locked snapshot. - Entity
Change Senders - Packet sinks used by
EntityTracker::send_changes. - Entity
Chunk Callback - Callback attached to each entity for tracking chunk/section movement.
- Entity
Fire Freeze State - Vanilla base fire and freezing state.
- Entity
Fluid Contact - Fluid heights intersecting an entityβs current bounding box.
- Entity
Ground Contact - Vanilla ground-support state updated by
Entity.checkSupportingBlock. - Entity
Lifecycle Changes - Entity lifecycle changes caused by manager membership or visibility updates.
- Entity
Load Request - Entity load request before the registry assigns a runtime ID.
- Entity
Move Update - Section/chunk membership update caused by a committed entity move.
- Entity
Movement - A vanilla movement segment used by block-contact effects.
- Entity
Movement Flags - Vanilla collision and ground-contact flags updated by
Entity.move. - Entity
Movement Progress - Vanilla movement distance counters used by step, swim, and flap side effects.
- Entity
Movement Sync Packets - At most two movement packets are emitted for one tracked movement update: one body movement/rotation packet and one head-rotation packet.
- Entity
Movement Sync State - Per-entity movement sync state for tracked position and rotation.
- Entity
Movement Sync Update - Runtime values accepted by tracked entity movement sync.
- Entity
Position Sync Snapshot - Runtime values needed to build a vanilla position sync packet.
- Entity
Position Sync State - Per-entity position sync state shared by player and entity tracking.
- Entity
Registry - Registry for entity factories.
- Entity
Rotation Sync State - Last packed rotation values known to tracking clients.
- Entity
Tracker - World-level entity tracker.
- Entity
Velocity Sync State - Per-entity velocity sync state for tracked entities.
- Inactive
Entity Callback - Callback for entities retained outside live world membership.
- Inside
Block Effect Collector - Step-scoped collector for vanilla inside-block side effects.
- Living
Entity Base - Common runtime fields shared by all living entities.
- Living
Rotation State - Vanilla living-entity body/head rotation state.
- Living
Swing State - Vanilla arm-swing animation state stored on
LivingEntity. - Living
Travel Input - Movement input stored on vanilla
LivingEntity. - MobEffect
Instance - Runtime mob-effect state.
- Null
Entity Callback - Null callback for entities not yet in the world.
- Packed
Entity Rotation - Packed body rotation used by entity movement packets.
- Pending
World Change Token - Runtime token for an in-flight world change request.
- Player
Entity Callback - Callback for players.
- Server
Entity Movement Sync State - Per-tracked-entity movement state owned by the entity tracker.
- Server
Entity Movement Sync Update - Runtime values accepted by vanilla
ServerEntity.sendChangesmovement sync. - Swimming
Environment π - World
Entity Manager - Central world entity manager.
EnumsΒ§
- Accepted
Client Movement Outcome - Result of applying accepted client-authored movement.
- AddEntity
Error - Error returned when adding an entity to the runtime world fails.
- Block
Effect πSegment Result - Entity
Anchor - The point on an entity used by commands that resolve positions or facing.
- Entity
Move Error - Error returned when a live entity move cannot be committed.
- Entity
Movement Emission - Vanilla movement side effects emitted by
Entity.move. - Entity
Movement Sync Packet - Concrete movement sync packet ready for broadcast.
- Entity
Ownership - Whether the manager owns persistence for an entity.
- Entity
Position RotSync Packet - Position sync packet for entities that include rotation in delta updates.
- Entity
Position Sync Decision - Encoded position sync selected for an entity movement update.
- Entity
Position Sync Packet - Position sync packet for entities that do not include rotation in delta updates.
- Entity
Vertical Movement State Update - Vanilla server-driven gate for vertical collision and ground-contact updates.
- Entity
Visibility - Entity visibility for a chunk column.
- Inside
Block Effect Type - Vanilla inside-block effect kinds applied after entity/block intersections.
- MobEffect
Sync Change - A queued mob-effect packet change produced by living effect state.
- MobEffect
Sync Packet - Concrete mob-effect packet ready to send to a player connection.
- Removal
Reason - Reasons an entity can be removed from the world.
- Teleport
Position πCommit
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_
MAX_ AIR_ SUPPLY - Default vanilla
Entity.getMaxAirSupplyvalue. - DEFAULT_
SWING_ DURATION - Vanilla default
SwingAnimationduration in ticks. - DEFAULT_
TICKS_ REQUIRED_ TO_ FREEZE - Default vanilla
Entity.getTicksRequiredToFreezevalue. - IN_
WALL_ πEYE_ BOX_ HEIGHT - KNOCKBACK_
DIRECTION_ πEPSILON_ SQ - LEASH_
SCAN_ πHALF_ SIZE - LEASH_
SCAN_ πSIZE - MAX_
ENTITY_ TAGS - Vanilla scoreboard tag limit for a single entity.
- 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Β§
- Entity
- A trait for entities.
- Entity
Event Source - Object-safe access to an entity trait object from default
Entitymethods. - Entity
Level Callback - Callback interface for entity lifecycle events.
- Entity
Synced Data - Thread-safe access to an entityβs vanilla synchronized data.
- Item
Frame - Vanilla
ItemFramebehavior used by comparators. - Living
Entity - A trait for living entities that can take damage, heal, and die.
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 - 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 - horizontal_
distance π - indirect_
passengers π - init_
entities - Initializes the global entity registry, once the main registry is frozen.
- is_
in_ πrain - leash_
scan_ πarea - 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 - Matches vanilla
LivingEntity.resetForwardDirectionOfRelativePortalPosition. - select_
swimming_ πstate - send_
teleport_ πtransition_ to_ riding_ players - should_
apply_ πentity_ cramming_ damage - should_
apply_ πresolved_ movement - start_
riding_ πentities - 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Β§
- Active
MobEffect - Active mob-effect state stored on a living entity.
- Inside
Block Effect Callback - Callback queued around an inside-block effect.
- Shared
Entity - Type alias for a shared entity reference.
- Weak
Entity - Type alias for a weak entity reference.