Skip to main content

LivingEntity

Trait LivingEntity 

Source
pub trait LivingEntity: Entity {
Show 261 methods // Required methods fn living_base(&self) -> &LivingEntityBase; fn get_health(&self) -> f32; fn set_health(&self, health: f32); // Provided methods fn living_rotation_state(&self) -> LivingRotationState { ... } fn y_body_rot(&self) -> f32 { ... } fn set_y_body_rot(&self, y_body_rot: f32) { ... } fn y_head_rot(&self) -> f32 { ... } fn set_y_head_rot(&self, y_head_rot: f32) { ... } fn advance_living_rotation_for_base_tick(&self) { ... } fn base_tick_living_entity(&self) { ... } fn living_swing_state(&self) -> LivingSwingState { ... } fn modified_swing_duration(&self, animation: SwingAnimation) -> i32 { ... } fn attack_animation(&self, hand: InteractionHand) -> SwingAnimation { ... } fn interact_animation(&self, hand: InteractionHand) -> SwingAnimation { ... } fn held_swing_animation( &self, hand: InteractionHand, component: DataComponentType<SwingAnimation>, ) -> SwingAnimation { ... } fn swing( &self, hand: InteractionHand, animation: SwingAnimation, update_self: bool, ) -> bool { ... } fn swing_for_attack(&self, hand: InteractionHand) { ... } fn attributes(&self) -> &SyncMutex<AttributeMap> { ... } fn get_luck(&self) -> f32 { ... } fn pack_syncable_attributes(&self) -> Vec<AttributeSnapshot> { ... } fn drain_dirty_syncable_attributes(&self) -> Vec<AttributeSnapshot> { ... } fn drain_dirty_mob_effects(&self) -> Vec<MobEffectSyncChange> { ... } fn pack_all_equipment(&self) -> Vec<EquipmentSlotItem> { ... } fn drain_dirty_equipment(&self) -> Vec<EquipmentSlotItem> { ... } fn save_equipment(&self, nbt: &mut NbtCompound) { ... } fn load_equipment(&self, nbt: BorrowedNbtCompoundView<'_, '_>) { ... } fn save_command_nbt(&self, nbt: &mut NbtCompound) { ... } fn get_max_health(&self) -> f32 { ... } fn no_action_time(&self) -> i32 { ... } fn set_no_action_time(&self, no_action_time: i32) { ... } fn increment_no_action_time(&self) { ... } fn heal(&self, amount: f32) { ... } fn is_dead_or_dying(&self) -> bool { ... } fn is_baby(&self) -> bool { ... } fn sheep_loot_state(&self) -> Option<(DyeColor, bool)> { ... } fn chicken_loot_variant(&self) -> Option<&Identifier> { ... } fn sound_volume(&self) -> f32 { ... } fn voice_pitch(&self) -> f32 { ... } fn default_voice_pitch(&self) -> f32 { ... } fn hurt_sound(&self, _source: &DamageSource) -> Option<SoundEventRef> { ... } fn death_sound(&self) -> Option<SoundEventRef> { ... } fn make_sound(&self, sound: Option<SoundEventRef>) { ... } fn play_hurt_sound(&self, source: &DamageSource) { ... } fn play_death_sound(&self) { ... } fn get_age_scale(&self) -> f32 { ... } fn get_scale(&self) -> f32 { ... } fn is_alive(&self) -> bool { ... } fn get_armor_cover_percentage(&self) -> f32 { ... } fn get_visibility_percent( &self, targeting_entity: Option<&dyn Entity>, ) -> f64 { ... } fn disguise_head_matches_targeting_entity( &self, targeting_entity: Option<&dyn Entity>, ) -> bool { ... } fn can_be_seen_by_anyone(&self) -> bool { ... } fn can_be_seen_as_enemy(&self) -> bool { ... } fn can_attack(&self, target: &dyn LivingEntity) -> bool { ... } fn last_damage_source(&self) -> Option<RecentDamageSource> { ... } fn record_last_damage_source(&self, source: &DamageSource) { ... } fn set_last_hurt_by_player(&self, player_uuid: Uuid, time_to_remember: i32) { ... } fn invulnerable_time(&self) -> i32 { ... } fn set_invulnerable_time(&self, invulnerable_time: i32) { ... } fn set_last_hurt_by_player_memory_time(&self, time_to_remember: i32) { ... } fn last_hurt_by_player_memory_time(&self) -> i32 { ... } fn last_hurt_by_player_uuid(&self) -> Option<Uuid> { ... } fn last_hurt_by_mob(&self) -> Option<SharedEntity> { ... } fn last_hurt_by_mob_timestamp(&self) -> i32 { ... } fn set_last_hurt_by_mob(&self, target: Option<&SharedEntity>) { ... } fn last_hurt_mob(&self) -> Option<SharedEntity> { ... } fn last_hurt_mob_timestamp(&self) -> i32 { ... } fn set_last_hurt_mob(&self, target: Option<&SharedEntity>) { ... } fn resolve_mob_responsible_for_damage(&self, source: &DamageSource) { ... } fn resolve_player_responsible_for_damage(&self, source: &DamageSource) { ... } fn has_line_of_sight(&self, target: &dyn Entity) -> bool { ... } fn has_line_of_sight_with( &self, target: &dyn Entity, block_shape: ClipBlockShape, fluid: ClipFluid, target_eye_y: f64, ) -> bool { ... } fn default_is_invulnerable_to(&self, source: &DamageSource) -> bool { ... } fn is_invulnerable_to(&self, _world: &World, source: &DamageSource) -> bool { ... } fn hurt_server( &self, world: &World, source: &DamageSource, amount: f32, ) -> bool { ... } fn default_hurt_server( &self, world: &World, source: &DamageSource, amount: f32, ) -> bool { ... } fn before_actually_hurt(&self, _source: &DamageSource, _amount: f32) { ... } fn hurt_armor(&self, _source: &DamageSource, _damage: f32) { ... } fn do_hurt_equipment( &self, source: &DamageSource, damage: f32, slots: &[EquipmentSlot], ) { ... } fn get_damage_after_armor_absorb( &self, source: &DamageSource, damage: f32, ) -> f32 { ... } fn get_damage_after_magic_absorb( &self, source: &DamageSource, damage: f32, ) -> f32 { ... } fn actually_hurt(&self, world: &World, source: &DamageSource, amount: f32) { ... } fn apply_damage_knockback(&self, source: &DamageSource) { ... } fn damage_knockback_direction(&self, source: &DamageSource) -> (f64, f64) { ... } fn knockback(&self, power: f64, xd: f64, zd: f64) { ... } fn knockback_resistance(&self) -> f64 { ... } fn indicate_damage(&self, _xd: f64, _zd: f64) { ... } fn hurt_broadcast_chunk(&self) -> ChunkPos { ... } fn broadcast_damage_event(&self, world: &World, source: &DamageSource) { ... } fn check_totem_death_protection(&self, source: &DamageSource) -> bool { ... } fn die(&self, source: &DamageSource) { ... } fn handle_killing_blow(&self) { ... } fn should_drop_loot(&self, world: &World) -> bool { ... } fn should_drop_experience(&self) -> bool { ... } fn is_always_experience_dropper(&self) -> bool { ... } fn skip_drop_experience(&self) { ... } fn was_experience_consumed(&self) -> bool { ... } fn base_experience_reward(&self) -> i32 { ... } fn experience_reward( &self, _world: &World, _killer_entity: Option<&dyn Entity>, ) -> i32 { ... } fn drop_all_death_loot(&self, source: &DamageSource) { ... } fn drop_experience( &self, world: &Arc<World>, killer_entity: Option<&dyn Entity>, ) { ... } fn death_loot_table(&self) -> Option<LootTableRef> { ... } fn death_loot_table_seed(&self) -> i64 { ... } fn drop_from_loot_table( &self, source: &DamageSource, killed_by_player: bool, ) { ... } fn drop_custom_death_loot( &self, _source: &DamageSource, _killed_by_player: bool, ) { ... } fn tick_death(&self) { ... } fn get_absorption_amount(&self) -> f32 { ... } fn set_absorption_amount(&self, amount: f32) { ... } fn fall_damage_sound(&self, damage: i32) -> SoundEventRef { ... } fn play_block_fall_sound(&self) { ... } fn cause_living_fall_damage( &self, fall_distance: f64, damage_modifier: f32, source: &DamageSource, ) -> bool { ... } fn get_armor_value(&self) -> i32 { ... } fn get_attribute_gravity(&self) -> f64 { ... } fn get_effective_gravity(&self) -> f64 { ... } fn is_affected_by_potions(&self) -> bool { ... } fn is_inverted_heal_and_harm(&self) -> bool { ... } fn default_can_be_affected(&self, effect: &MobEffectInstance) -> bool { ... } fn can_be_affected(&self, effect: &MobEffectInstance) -> bool { ... } fn has_mob_effect(&self, effect: MobEffectRef) -> bool { ... } fn mob_effect(&self, effect: MobEffectRef) -> Option<ActiveMobEffect> { ... } fn active_mob_effects(&self) -> Vec<ActiveMobEffect> ⓘ { ... } fn set_mob_effect(&self, effect: MobEffectRef, amplifier: i32) { ... } fn add_mob_effect(&self, effect: MobEffectInstance) -> bool { ... } fn add_mob_effect_with_source( &self, effect: MobEffectInstance, source: Option<&dyn Entity>, ) -> bool { ... } fn set_mob_effect_active(&self, effect: MobEffectRef, active: bool) { ... } fn remove_mob_effect(&self, effect: MobEffectRef) -> bool { ... } fn tick_mob_effects(&self) { ... } fn has_water_breathing(&self) -> bool { ... } fn should_effects_refill_air_supply(&self) -> bool { ... } fn can_breathe_underwater(&self) -> bool { ... } fn can_drown_in_water(&self) -> bool { ... } fn is_eye_in_bubble_column(&self) -> bool { ... } fn decrease_air_supply(&self, current_supply: i32) -> i32 { ... } fn increase_air_supply(&self, current_supply: i32) -> i32 { ... } fn should_take_drowning_damage(&self) -> bool { ... } fn tick_living_air_supply(&self) { ... } fn is_in_wall(&self) -> bool { ... } fn tick_in_wall_damage(&self) { ... } fn tick_living_environmental_damage(&self) { ... } fn is_affected_by_fluids(&self) -> bool { ... } fn can_stand_on_fluid(&self, _fluid_state: FluidState) -> bool { ... } fn is_using_item(&self) -> bool { ... } fn is_blocking(&self) -> bool { ... } fn is_fall_flying(&self) -> bool { ... } fn set_fall_flying(&self, fall_flying: bool) { ... } fn fall_flying_ticks(&self) -> i32 { ... } fn with_equipment_slot( &self, slot: EquipmentSlot, visitor: &mut dyn FnMut(&ItemStack), ) { ... } fn is_holding(&self, predicate: &mut dyn FnMut(&ItemStack) -> bool) -> bool { ... } fn tick_equipment(&self) { ... } fn with_equipment_slot_mut( &self, slot: EquipmentSlot, visitor: &mut dyn FnMut(&mut ItemStack), ) { ... } fn has_item_in_slot(&self, slot: EquipmentSlot) -> bool { ... } fn can_use_slot(&self, _slot: EquipmentSlot) -> bool { ... } fn can_dispenser_equip_into_slot(&self, _slot: EquipmentSlot) -> bool { ... } fn can_equip_with_dispenser(&self, item_stack: &ItemStack) -> bool { ... } fn is_equippable_in_slot( &self, item_stack: &ItemStack, slot: EquipmentSlot, ) -> bool { ... } fn equip_sound( &self, slot: EquipmentSlot, stack: &ItemStack, ) -> Option<SoundEventRef> { ... } fn on_equip_item( &self, slot: EquipmentSlot, previous: &ItemStack, stack: &ItemStack, ) { ... } fn interact_living_entity_with_equippable( &self, player: &Player, hand: InteractionHand, ) -> InteractionResult { ... } fn refresh_equipment_attribute_modifiers(&self, slot: EquipmentSlot) { ... } fn detect_equipment_updates(&self) { ... } fn pack_living_equipment(&self) -> Vec<EquipmentSlotItem> { ... } fn drain_dirty_living_equipment(&self) -> Vec<EquipmentSlotItem> { ... } fn has_infinite_materials(&self) -> bool { ... } fn handle_extra_items_created_on_use(&self, _extra: ItemStack) { ... } fn on_equipped_item_broken(&self, _item: ItemRef, slot: EquipmentSlot) { ... } fn default_living_can_freeze(&self) -> bool { ... } fn is_on_non_air_block_for_frost(&self) -> bool { ... } fn remove_frost(&self) { ... } fn try_add_frost(&self) { ... } fn tick_freezing(&self) { ... } fn tick_living_entity(&self, entity: &SharedEntity) { ... } fn tick_living_state(&self) { ... } fn can_glide_using( &self, item_stack: &ItemStack, slot: EquipmentSlot, ) -> bool { ... } fn can_glide_using_equipment_slot(&self, slot: EquipmentSlot) -> bool { ... } fn damage_random_glider(&self) { ... } fn default_can_glide(&self) -> bool { ... } fn can_glide(&self) -> bool { ... } fn start_fall_flying(&self) { ... } fn try_to_start_fall_flying(&self) -> bool { ... } fn last_climbable_pos(&self) -> Option<BlockPos> { ... } fn set_last_climbable_pos(&self, pos: BlockPos) { ... } fn default_living_on_climbable(&self) -> bool { ... } fn should_discard_friction(&self) -> bool { ... } fn set_discard_friction(&self, discard_friction: bool) { ... } fn is_jumping(&self) -> bool { ... } fn set_jumping(&self, jumping: bool) { ... } fn travel_input(&self) -> LivingTravelInput { ... } fn set_travel_input(&self, input: LivingTravelInput) { ... } fn apply_input(&self) { ... } fn no_jump_delay(&self) -> i32 { ... } fn set_no_jump_delay(&self, ticks: i32) { ... } fn tick_no_jump_delay(&self) { ... } fn hurt_time(&self) -> i32 { ... } fn default_is_immobile(&self) -> bool { ... } fn is_immobile(&self) -> bool { ... } fn apply_living_velocity_thresholds(&self) { ... } fn server_ai_step(&self, _entity: &SharedEntity) { ... } fn get_jump_boost_power(&self) -> f32 { ... } fn get_jump_power_with_multiplier(&self, multiplier: f32) -> f32 { ... } fn get_jump_power(&self) -> f32 { ... } fn default_jump_from_ground(&self) { ... } fn jump_from_ground(&self) { ... } fn go_down_in_water(&self) { ... } fn jump_in_liquid(&self, _fluid_tag: &Identifier) { ... } fn handle_living_jump(&self) { ... } fn tick_ridden(&self, _controller: &Player, _ridden_input: DVec3) { ... } fn ridden_input(&self, _controller: &Player, self_input: DVec3) -> DVec3 { ... } fn ridden_speed(&self, _controller: &Player) -> f32 { ... } fn travel_ridden( &self, entity: &SharedEntity, controller: &Player, self_input: DVec3, ) -> Option<MoveResult> { ... } fn default_ai_step(&self, entity: &SharedEntity) -> Option<MoveResult> { ... } fn ai_step(&self, entity: &SharedEntity) -> Option<MoveResult> { ... } fn push_entities(&self) { ... } fn push_entities_in_order(&self, entities: &[SharedEntity]) { ... } fn apply_entity_cramming_damage( &self, world: &World, pushable_entities: &[SharedEntity], ) { ... } fn is_suppressing_sliding_down_ladder(&self) -> bool { ... } fn levitation_travel_y_delta(&self, movement_y: f64) -> Option<f64> { ... } fn should_travel_in_fluid(&self, fluid_state: FluidState) -> bool { ... } fn get_water_slow_down(&self) -> f32 { ... } fn water_movement_efficiency(&self) -> f32 { ... } fn has_dolphins_grace(&self) -> bool { ... } fn get_flying_speed(&self) -> f32 { ... } fn get_friction_influenced_speed(&self, block_friction: f32) -> f32 { ... } fn air_travel_vertical_friction(&self, _horizontal_friction: f32) -> f32 { ... } fn handle_on_climbable(&self, movement: DVec3) -> DVec3 { ... } fn apply_living_travel_gravity(&self) { ... } fn handle_relative_friction_and_calculate_movement( &self, entity: &SharedEntity, input: DVec3, block_friction: f32, ) -> Option<(DVec3, MoveResult)> { ... } fn travel_in_air( &self, entity: &SharedEntity, input: DVec3, ) -> Option<MoveResult> { ... } fn get_fluid_falling_adjusted_movement( &self, base_gravity: f64, is_falling: bool, movement: DVec3, ) -> DVec3 { ... } fn jump_out_of_fluid(&self, old_y: f64) { ... } fn float_in_water_while_ridden(&self) { ... } fn travel_in_water( &self, entity: &SharedEntity, input: DVec3, base_gravity: f64, is_falling: bool, old_y: f64, ) -> Option<MoveResult> { ... } fn travel_in_lava( &self, entity: &SharedEntity, input: DVec3, base_gravity: f64, is_falling: bool, old_y: f64, ) -> Option<MoveResult> { ... } fn travel_in_fluid( &self, entity: &SharedEntity, input: DVec3, ) -> Option<MoveResult> { ... } fn update_fall_flying(&self) { ... } fn update_fall_flying_movement(&self, movement: DVec3) -> DVec3 { ... } fn stop_fall_flying(&self) { ... } fn handle_fall_flying_collisions( &self, previous_horizontal_speed: f64, new_horizontal_speed: f64, ) { ... } fn travel_fall_flying( &self, entity: &SharedEntity, input: DVec3, ) -> Option<MoveResult> { ... } fn default_travel( &self, entity: &SharedEntity, input: DVec3, ) -> Option<MoveResult> { ... } fn travel(&self, entity: &SharedEntity, input: DVec3) -> Option<MoveResult> { ... } fn sleeping_pos(&self) -> Option<BlockPos> { ... } fn set_sleeping_pos(&self, bed_position: BlockPos) { ... } fn clear_sleeping_pos(&self) { ... } fn is_sleeping(&self) -> bool { ... } fn living_synced_data(&self) -> Option<&dyn LivingEntitySyncedData> { ... } fn start_sleeping( &self, bed_position: BlockPos, ) -> Result<(), EntityMoveError> { ... } fn default_stop_sleeping(&self) { ... } fn stop_sleeping(&self) { ... } fn is_sprinting(&self) -> bool { ... } fn set_sprinting(&self, sprinting: bool) { ... } fn get_speed(&self) -> f32 { ... } fn set_speed(&self, speed: f32) { ... } fn apply_post_impulse_grace_time(&self, ticks: i32) { ... } fn set_ignore_fall_damage_from_current_impulse( &self, ignore_fall_damage: bool, new_impulse_impact_pos: DVec3, ) { ... } fn is_ignoring_fall_damage_from_current_impulse(&self) -> bool { ... } fn current_impulse_impact_pos(&self) -> Option<DVec3> { ... } fn try_reset_current_impulse_context(&self) { ... } fn reset_current_impulse_context(&self) { ... } fn is_in_post_impulse_grace_time(&self) -> bool { ... } fn tick_post_impulse_grace_time(&self) { ... } fn refresh_dirty_attributes(&self) { ... } fn random_teleport( &self, world: &Arc<World>, x: f64, y: f64, z: f64, broadcast: bool, ) -> bool { ... }
}
Expand description

A trait for living entities that can take damage, heal, and die.

This trait provides the core functionality for entities that have health, can be damaged, and can die. It’s based on Minecraft’s LivingEntity class.

Note: All methods take &self (not &mut self) because living entities are shared via Arc and use interior mutability (SyncMutex, etc.).

Required Methods§

Source

fn living_base(&self) -> &LivingEntityBase

Returns a reference to the shared LivingEntityBase that holds living runtime state such as attributes, cached movement speed, damage cooldown, and death animation counters.

Source

fn get_health(&self) -> f32

Gets the current health of the entity.

Source

fn set_health(&self, health: f32)

Sets the health of the entity, clamped between 0 and max health.

Provided Methods§

Source

fn living_rotation_state(&self) -> LivingRotationState

Returns vanilla living body/head rotation state.

Source

fn y_body_rot(&self) -> f32

Returns the entity’s body yaw, used for turning smoothing separate from head yaw.

Source

fn set_y_body_rot(&self, y_body_rot: f32)

Sets the entity’s body yaw.

Source

fn y_head_rot(&self) -> f32

Returns the entity’s head yaw.

Source

fn set_y_head_rot(&self, y_head_rot: f32)

Sets the entity’s head yaw.

Source

fn advance_living_rotation_for_base_tick(&self)

Copies current living body/head rotations to vanilla old-rotation state.

Source

fn base_tick_living_entity(&self)

Runs the shared per-tick living-entity behavior: rotation/animation snapshots, base entity tick, environmental damage, the hurt timer, and combat memory expiry. Memory must expire before mob effects tick, so a lethal effect tick sees the same kill credit as vanilla.

Source

fn living_swing_state(&self) -> LivingSwingState

Returns vanilla arm-swing animation state.

Source

fn modified_swing_duration(&self, animation: SwingAnimation) -> i32

Returns the animation duration adjusted by Haste or Mining Fatigue.

Source

fn attack_animation(&self, hand: InteractionHand) -> SwingAnimation

Returns the held item’s attack animation.

Source

fn interact_animation(&self, hand: InteractionHand) -> SwingAnimation

Returns the held item’s interaction animation.

Source

fn held_swing_animation( &self, hand: InteractionHand, component: DataComponentType<SwingAnimation>, ) -> SwingAnimation

Reads a swing animation component off the item held in hand, falling back to the vanilla default when the item does not carry one.

Source

fn swing( &self, hand: InteractionHand, animation: SwingAnimation, update_self: bool, ) -> bool

Sends the animation to tracking players and returns whether a swing started

Source

fn swing_for_attack(&self, hand: InteractionHand)

Swings with the held item’s attack animation.

Source

fn attributes(&self) -> &SyncMutex<AttributeMap>

Returns a reference to this entity’s attribute map.

Source

fn get_luck(&self) -> f32

Vanilla LivingEntity.getLuck - non-players contribute no luck to loot.

Source

fn pack_syncable_attributes(&self) -> Vec<AttributeSnapshot>

Packs syncable attributes for initial spawn pairing.

Mirrors vanilla ServerEntity.sendPairingData, which sends all syncable living attributes after the add-entity and metadata packets.

Source

fn drain_dirty_syncable_attributes(&self) -> Vec<AttributeSnapshot>

Drains syncable dirty attributes for per-tick tracking updates.

Mirrors vanilla ServerEntity.sendDirtyEntityData, which sends dirty living attributes after dirty entity data.

Source

fn drain_dirty_mob_effects(&self) -> Vec<MobEffectSyncChange>

Drains dirty mob-effect packet changes for vanilla recipients.

Source

fn pack_all_equipment(&self) -> Vec<EquipmentSlotItem>

Packs non-empty equipment slots for initial spawn pairing.

Source

fn drain_dirty_equipment(&self) -> Vec<EquipmentSlotItem>

Drains equipment slots that changed since the last tracker sync.

Source

fn save_equipment(&self, nbt: &mut NbtCompound)

Saves equipment slots to NBT.

Source

fn load_equipment(&self, nbt: BorrowedNbtCompoundView<'_, '_>)

Loads equipment slots from NBT.

Source

fn save_command_nbt(&self, nbt: &mut NbtCompound)

Appends vanilla-shaped living state used by command NBT predicates.

Source

fn get_max_health(&self) -> f32

Gets the maximum health from the attribute system.

Source

fn no_action_time(&self) -> i32

Returns ticks this entity has gone without taking a noteworthy action.

Source

fn set_no_action_time(&self, no_action_time: i32)

Sets ticks this entity has gone without taking a noteworthy action.

Source

fn increment_no_action_time(&self)

Increments the no-action-time counter by one tick.

Source

fn heal(&self, amount: f32)

Heals the entity by the specified amount.

Source

fn is_dead_or_dying(&self) -> bool

Returns true if the entity is dead or dying (health <= 0).

Source

fn is_baby(&self) -> bool

Returns whether this entity is currently a baby.

Source

fn sheep_loot_state(&self) -> Option<(DyeColor, bool)>

Returns the vanilla sheep loot predicate state (minecraft:components.sheep/color together with minecraft:type_specific/sheep.sheared), when this entity is a sheep.

Mirrors Sheep.get(DataComponents.SHEEP_COLOR) + Sheep.isSheared() for the entity loot context.

Source

fn chicken_loot_variant(&self) -> Option<&Identifier>

Returns this entity’s minecraft:components.chicken/variant key for the entity loot context, when it is a chicken.

Mirrors Chicken.get(DataComponents.CHICKEN_VARIANT) for the loot predicate.

Source

fn sound_volume(&self) -> f32

Returns the volume used for this entity’s sounds.

Source

fn voice_pitch(&self) -> f32

Returns the pitch used for this entity’s sounds; babies get a randomized higher pitch.

Source

fn default_voice_pitch(&self) -> f32

Returns the base voice pitch before entity-specific adjustments.

Source

fn hurt_sound(&self, _source: &DamageSource) -> Option<SoundEventRef>

Returns the sound played when this entity is hurt.

Source

fn death_sound(&self) -> Option<SoundEventRef>

Returns the sound played when this entity dies.

Source

fn make_sound(&self, sound: Option<SoundEventRef>)

Plays sound at this entity’s current volume and pitch, if any.

Source

fn play_hurt_sound(&self, source: &DamageSource)

Plays this entity’s hurt sound and resets its ambient-sound timer if it’s a mob.

Source

fn play_death_sound(&self)

Plays vanilla’s death sound for this living entity.

Source

fn get_age_scale(&self) -> f32

Returns the render scale from age: 0.5 for babies, 1.0 for adults.

Source

fn get_scale(&self) -> f32

Returns this entity’s overall render scale, from the scale attribute.

Source

fn is_alive(&self) -> bool

Returns true if the entity is alive (health > 0).

Source

fn get_armor_cover_percentage(&self) -> f32

Returns the fraction of armor slots that currently have equipment, used for armor-tint rendering.

Source

fn get_visibility_percent(&self, targeting_entity: Option<&dyn Entity>) -> f64

Returns how visible this entity is, from 0.0 to 1.0: reduced while sneaking, invisible, or disguised with a matching mob head.

Source

fn disguise_head_matches_targeting_entity( &self, targeting_entity: Option<&dyn Entity>, ) -> bool

Returns whether the equipped head item reduces visibility to targeting_entity.

Source

fn can_be_seen_by_anyone(&self) -> bool

Returns whether this entity is currently visible to anything: alive and not a spectator.

Source

fn can_be_seen_as_enemy(&self) -> bool

Returns whether this entity can be targeted as an enemy: visible and not invulnerable.

Source

fn can_attack(&self, target: &dyn LivingEntity) -> bool

Returns whether this entity may attack target: never a player on peaceful difficulty, and only visible, non-invulnerable targets otherwise.

Source

fn last_damage_source(&self) -> Option<RecentDamageSource>

Returns the last damage source, unless it’s older than the timeout window, with RecentDamageSource retention semantics.

Source

fn record_last_damage_source(&self, source: &DamageSource)

Records a successful hit using the victim’s own level clock.

Source

fn set_last_hurt_by_player(&self, player_uuid: Uuid, time_to_remember: i32)

Records the player that last hurt this entity.

Source

fn invulnerable_time(&self) -> i32

Returns the remaining hurt-cooldown ticks (vanilla Entity.invulnerableTime).

Source

fn set_invulnerable_time(&self, invulnerable_time: i32)

Sets the remaining hurt-cooldown ticks.

Source

fn set_last_hurt_by_player_memory_time(&self, time_to_remember: i32)

Sets the remaining memory time without touching the remembered player.

Source

fn last_hurt_by_player_memory_time(&self) -> i32

Returns ticks remaining that this entity will remember the player who last hurt it.

Source

fn last_hurt_by_player_uuid(&self) -> Option<Uuid>

Returns vanilla LivingEntity.lastHurtByPlayer, if still remembered.

Source

fn last_hurt_by_mob(&self) -> Option<SharedEntity>

Returns the mob that last hurt this entity, if still resolvable.

Source

fn last_hurt_by_mob_timestamp(&self) -> i32

Returns the tick timestamp this entity was last hurt by a mob.

Source

fn set_last_hurt_by_mob(&self, target: Option<&SharedEntity>)

Records the mob that last hurt this entity.

Source

fn last_hurt_mob(&self) -> Option<SharedEntity>

Returns the mob this entity last hurt, if still resolvable.

Source

fn last_hurt_mob_timestamp(&self) -> i32

Returns the tick timestamp this entity last hurt a mob.

Source

fn set_last_hurt_mob(&self, target: Option<&SharedEntity>)

Records the mob this entity last hurt.

Source

fn resolve_mob_responsible_for_damage(&self, source: &DamageSource)

Records the causing entity as this entity’s last-hurt-by mob, skipping damage types that shouldn’t provoke anger (e.g. no_anger, or wind charges when this mob is immune to their anger).

Source

fn resolve_player_responsible_for_damage(&self, source: &DamageSource)

Records the causing entity as this entity’s last-hurt-by player, if the causing entity is a player.

Source

fn has_line_of_sight(&self, target: &dyn Entity) -> bool

Returns whether this entity has an unobstructed line of sight to target’s eyes.

Source

fn has_line_of_sight_with( &self, target: &dyn Entity, block_shape: ClipBlockShape, fluid: ClipFluid, target_eye_y: f64, ) -> bool

Returns vanilla line-of-sight with explicit clip options.

Source

fn default_is_invulnerable_to(&self, source: &DamageSource) -> bool

Returns vanilla base living-entity invulnerability.

Source

fn is_invulnerable_to(&self, _world: &World, source: &DamageSource) -> bool

Returns whether this living entity ignores a damage source.

Source

fn hurt_server(&self, world: &World, source: &DamageSource, amount: f32) -> bool

Main vanilla living-entity damage entry point.

world is the ServerLevel supplied by the vanilla caller. It may intentionally differ from the entity’s attached world.

Source

fn default_hurt_server( &self, world: &World, source: &DamageSource, amount: f32, ) -> bool

Runs the base LivingEntity.hurtServer body.

Overrides of Self::hurt_server call this where vanilla calls super.hurtServer; the Ender Dragon routes its per-part damage scaling through here.

Source

fn before_actually_hurt(&self, _source: &DamageSource, _amount: f32)

Hook before applying damage after vanilla reductions.

Source

fn hurt_armor(&self, _source: &DamageSource, _damage: f32)

Damages equipment that participates in vanilla armor absorption.

Source

fn do_hurt_equipment( &self, source: &DamageSource, damage: f32, slots: &[EquipmentSlot], )

Damages equipped items in the given slots that are eligible to absorb this damage source.

Source

fn get_damage_after_armor_absorb( &self, source: &DamageSource, damage: f32, ) -> f32

Reduces damage by the entity’s armor value and toughness, unless the source bypasses armor.

Source

fn get_damage_after_magic_absorb( &self, source: &DamageSource, damage: f32, ) -> f32

Reduces damage based on the resistance effect, unless the source bypasses it or effects entirely.

Source

fn actually_hurt(&self, world: &World, source: &DamageSource, amount: f32)

Applies damage after vanilla reductions.

Source

fn apply_damage_knockback(&self, source: &DamageSource)

Applies vanilla hurt knockback for a damage source.

Source

fn damage_knockback_direction(&self, source: &DamageSource) -> (f64, f64)

Returns the horizontal direction used by vanilla damage knockback.

Source

fn knockback(&self, power: f64, xd: f64, zd: f64)

Applies knockback velocity in the direction (xd, zd), scaled by power and reduced by knockback resistance.

Source

fn knockback_resistance(&self) -> f64

Returns vanilla knockback resistance.

Source

fn indicate_damage(&self, _xd: f64, _zd: f64)

Applies a client-visible damage knockback indication in the given direction.

Source

fn hurt_broadcast_chunk(&self) -> ChunkPos

Returns the chunk used for vanilla nearby hurt broadcasts.

Source

fn broadcast_damage_event(&self, world: &World, source: &DamageSource)

Broadcasts vanilla damage-event metadata near this entity.

Source

fn check_totem_death_protection(&self, source: &DamageSource) -> bool

Uses a held death-protection item to survive lethal damage. Returns whether one was used.

Source

fn die(&self, source: &DamageSource)

Processes vanilla living death side effects.

Source

fn handle_killing_blow(&self)

Runs vanilla LivingEntity.handleKillingBlow.

Vanilla’s body is this.dead = true, which Self::die has already done atomically by the time this runs. The hook exists for the subclasses that replace it: bosses playing a death animation clamp their health and enter a dying state here instead of falling over.

Source

fn should_drop_loot(&self, world: &World) -> bool

Returns vanilla LivingEntity.shouldDropLoot. Returns whether this entity should drop loot on death: not a baby, and the mob-drops game rule allows it.

Source

fn should_drop_experience(&self) -> bool

Returns whether this entity should drop experience on death: not a baby.

Source

fn is_always_experience_dropper(&self) -> bool

Returns whether this entity always drops experience regardless of the player-kill requirement; false by default.

Source

fn skip_drop_experience(&self)

Marks this entity to skip dropping experience on death.

Source

fn was_experience_consumed(&self) -> bool

Returns whether this entity has been marked to skip dropping experience.

Source

fn base_experience_reward(&self) -> i32

Returns the base experience reward for killing this entity, using the animal-specific reward when applicable.

Source

fn experience_reward( &self, _world: &World, _killer_entity: Option<&dyn Entity>, ) -> i32

Returns the experience reward for this entity’s death; currently equal to the base reward (see TODO).

Source

fn drop_all_death_loot(&self, source: &DamageSource)

Runs the currently implemented subset of vanilla LivingEntity.dropAllDeathLoot.

Source

fn drop_experience( &self, world: &Arc<World>, killer_entity: Option<&dyn Entity>, )

Awards experience for this entity’s death when eligible, spawning an experience orb.

Source

fn death_loot_table(&self) -> Option<LootTableRef>

Returns this entity’s death loot table: a mob’s custom override if set, otherwise the default table for its entity type.

Source

fn death_loot_table_seed(&self) -> i64

Returns the loot-table seed for this entity’s death loot, if it’s a mob.

Source

fn drop_from_loot_table(&self, source: &DamageSource, killed_by_player: bool)

Rolls and spawns this entity’s death-loot drops from its loot table, seeded deterministically when a loot-table seed is set.

Source

fn drop_custom_death_loot( &self, _source: &DamageSource, _killed_by_player: bool, )

Hook for non-mob custom death loot.

Source

fn tick_death(&self)

Ticks the vanilla living death animation and removes the entity at completion.

Source

fn get_absorption_amount(&self) -> f32

Gets the absorption amount (extra health from effects like absorption).

Source

fn set_absorption_amount(&self, amount: f32)

Sets the absorption amount.

Source

fn fall_damage_sound(&self, damage: i32) -> SoundEventRef

Returns the small or big fall sound based on damage.

Source

fn play_block_fall_sound(&self)

Plays the sound of the block this entity is standing in/on after a fall.

Source

fn cause_living_fall_damage( &self, fall_distance: f64, damage_modifier: f32, source: &DamageSource, ) -> bool

Applies fall damage to a living entity, factoring in effects that reduce or negate it.

Source

fn get_armor_value(&self) -> i32

Gets the entity’s armor value from the attribute system.

Source

fn get_attribute_gravity(&self) -> f64

Gets the gravity value from the attribute system.

Source

fn get_effective_gravity(&self) -> f64

Returns this entity’s gravity, reduced while falling under Slow Falling.

Source

fn is_affected_by_potions(&self) -> bool

Checks if the entity can be affected by potions.

Source

fn is_inverted_heal_and_harm(&self) -> bool

Returns whether healing and harm effects are inverted for this entity (e.g. undead mobs).

Source

fn default_can_be_affected(&self, effect: &MobEffectInstance) -> bool

Returns vanilla base LivingEntity.canBeAffected eligibility.

Source

fn can_be_affected(&self, effect: &MobEffectInstance) -> bool

Returns whether this entity accepts a mob-effect instance.

Concrete entities override this for vanilla class-specific immunities.

Source

fn has_mob_effect(&self, effect: MobEffectRef) -> bool

Returns whether this entity currently has effect active.

Source

fn mob_effect(&self, effect: MobEffectRef) -> Option<ActiveMobEffect>

Returns this entity’s active instance of effect, if any.

Source

fn active_mob_effects(&self) -> Vec<ActiveMobEffect> ⓘ

Returns all active vanilla mob effects.

Source

fn set_mob_effect(&self, effect: MobEffectRef, amplifier: i32)

Sets active vanilla mob-effect state.

Source

fn add_mob_effect(&self, effect: MobEffectInstance) -> bool

Adds or updates active vanilla mob-effect state.

Source

fn add_mob_effect_with_source( &self, effect: MobEffectInstance, source: Option<&dyn Entity>, ) -> bool

Adds or updates active vanilla mob-effect state, attributing it to source.

Source

fn set_mob_effect_active(&self, effect: MobEffectRef, active: bool)

Sets the presence of a vanilla mob effect.

Source

fn remove_mob_effect(&self, effect: MobEffectRef) -> bool

Removes active vanilla mob-effect state.

Source

fn tick_mob_effects(&self)

Ticks vanilla server-side mob-effect behavior and durations.

Source

fn has_water_breathing(&self) -> bool

Returns whether vanilla effects keep this entity from drowning.

Source

fn should_effects_refill_air_supply(&self) -> bool

Returns whether active vanilla effects refill this entity’s air supply.

Source

fn can_breathe_underwater(&self) -> bool

Returns whether this entity’s type can breathe underwater.

Source

fn can_drown_in_water(&self) -> bool

Returns whether this entity can lose air and take drowning damage.

Source

fn is_eye_in_bubble_column(&self) -> bool

Returns whether the entity’s eye block is a bubble column.

Source

fn decrease_air_supply(&self, current_supply: i32) -> i32

Decreases air supply while drowning, occasionally skipped when the oxygen bonus effect applies.

Source

fn increase_air_supply(&self, current_supply: i32) -> i32

Refills air supply while out of water, capped at the entity’s maximum.

Source

fn should_take_drowning_damage(&self) -> bool

Returns whether air supply has dropped low enough to start dealing drowning damage.

Source

fn tick_living_air_supply(&self)

Ticks vanilla living air-supply and drowning behavior from baseTick.

Source

fn is_in_wall(&self) -> bool

Returns whether the entity is suffocating in a wall, ignoring the check while sleeping.

Source

fn tick_in_wall_damage(&self)

Applies vanilla living in-wall damage from baseTick.

Source

fn tick_living_environmental_damage(&self)

Applies vanilla living environmental damage in LivingEntity.baseTick order.

Source

fn is_affected_by_fluids(&self) -> bool

Returns whether this entity is affected by fluid physics; true by default.

Source

fn can_stand_on_fluid(&self, _fluid_state: FluidState) -> bool

Returns whether this entity can stand on the given fluid’s surface; false by default.

Source

fn is_using_item(&self) -> bool

Checks if the entity is currently using an item.

Source

fn is_blocking(&self) -> bool

Checks if the entity is blocking with a shield or similar item.

Source

fn is_fall_flying(&self) -> bool

Checks if the entity is fall flying (using elytra).

Source

fn set_fall_flying(&self, fall_flying: bool)

Sets whether this entity is fall flying.

Source

fn fall_flying_ticks(&self) -> i32

Returns ticks this entity has been fall-flying.

Source

fn with_equipment_slot( &self, slot: EquipmentSlot, visitor: &mut dyn FnMut(&ItemStack), )

Visits the item in a vanilla living-entity equipment slot.

Source

fn is_holding(&self, predicate: &mut dyn FnMut(&ItemStack) -> bool) -> bool

Returns whether the item in this entity’s main hand matches predicate.

Source

fn tick_equipment(&self)

Ticks every equipped item.

Source

fn with_equipment_slot_mut( &self, slot: EquipmentSlot, visitor: &mut dyn FnMut(&mut ItemStack), )

Mutates the item in a vanilla living-entity equipment slot.

Source

fn has_item_in_slot(&self, slot: EquipmentSlot) -> bool

Returns whether this entity currently has an item in slot.

Source

fn can_use_slot(&self, _slot: EquipmentSlot) -> bool

Returns whether vanilla allows this entity to use slot.

Source

fn can_dispenser_equip_into_slot(&self, _slot: EquipmentSlot) -> bool

Returns the effective vanilla dispenser slot gate for living entities and mobs.

Source

fn can_equip_with_dispenser(&self, item_stack: &ItemStack) -> bool

Returns whether a dispenser may auto-equip this item onto this entity: alive, not a spectator, and the item is dispensable equipment for an open, usable slot this entity’s type accepts.

Source

fn is_equippable_in_slot( &self, item_stack: &ItemStack, slot: EquipmentSlot, ) -> bool

Returns whether item_stack may be worn in slot, defaulting to holdable-in-main-hand items with no equippable component.

Source

fn equip_sound( &self, slot: EquipmentSlot, stack: &ItemStack, ) -> Option<SoundEventRef>

Returns the equip sound Steel can currently resolve for this entity.

Source

fn on_equip_item( &self, slot: EquipmentSlot, previous: &ItemStack, stack: &ItemStack, )

Applies the sound portion of vanilla’s equipment-change hook.

Source

fn interact_living_entity_with_equippable( &self, player: &Player, hand: InteractionHand, ) -> InteractionResult

Runs vanilla’s equippable ItemStack.interactLivingEntity branch.

Source

fn refresh_equipment_attribute_modifiers(&self, slot: EquipmentSlot)

Refreshes transient item attribute modifiers for one equipment slot.

Source

fn detect_equipment_updates(&self)

Detects and applies Vanilla living-equipment changes once per tick.

Source

fn pack_living_equipment(&self) -> Vec<EquipmentSlotItem>

Packs non-empty living equipment slots for initial spawn pairing.

Source

fn drain_dirty_living_equipment(&self) -> Vec<EquipmentSlotItem>

Drains dirty living equipment slots for tracker sync.

Source

fn has_infinite_materials(&self) -> bool

Returns whether equipment durability should be skipped for this entity.

Source

fn handle_extra_items_created_on_use(&self, _extra: ItemStack)

Mirrors vanilla LivingEntity.handleExtraItemsCreatedOnUse, which is a no-op for non-player mobs.

Source

fn on_equipped_item_broken(&self, _item: ItemRef, slot: EquipmentSlot)

Called after an equipped item breaks.

Source

fn default_living_can_freeze(&self) -> bool

Returns vanilla LivingEntity.canFreeze() after concrete entity exemptions.

Vanilla keeps the entity-type freeze immunity on Entity and the equipment immunity on LivingEntity. Steel keeps this helper separate so concrete Entity::can_freeze implementations can delegate without downcasting.

Source

fn is_on_non_air_block_for_frost(&self) -> bool

Returns whether the block this entity is standing on is non-air, required for the powder-snow speed penalty to apply.

Source

fn remove_frost(&self)

Removes the powder snow speed penalty modifier.

Source

fn try_add_frost(&self)

Applies the powder snow speed penalty modifier if the entity is frozen and can freeze.

Source

fn tick_freezing(&self)

Ticks freeze-related state each AI step: cools ticks_frozen when not in powder snow (or unable to freeze), then refreshes the powder-snow speed penalty.

Source

fn tick_living_entity(&self, entity: &SharedEntity)

Runs vanilla LivingEntity.tick.

The default Entity::tick dispatches living entities here.

Source

fn tick_living_state(&self)

Ticks living-entity counters after movement.

Source

fn can_glide_using(&self, item_stack: &ItemStack, slot: EquipmentSlot) -> bool

Returns whether the given item in the given slot allows elytra-style gliding.

Source

fn can_glide_using_equipment_slot(&self, slot: EquipmentSlot) -> bool

Returns whether the item in slot can be used for vanilla gliding.

Source

fn damage_random_glider(&self)

Damages a random equipped item slot that’s currently enabling this entity to glide, breaking it if durability runs out.

Source

fn default_can_glide(&self) -> bool

Returns whether this entity meets the base conditions to glide: not grounded, not a passenger, not levitating, and wearing something that allows gliding.

Source

fn can_glide(&self) -> bool

Returns whether the entity currently meets the conditions to glide with an elytra.

Source

fn start_fall_flying(&self)

Puts the entity into the fall-flying (elytra gliding) state.

Source

fn try_to_start_fall_flying(&self) -> bool

Attempts to start fall flying if the entity isn’t already gliding, can glide, and isn’t in water.

Source

fn last_climbable_pos(&self) -> Option<BlockPos>

Returns the last climbable block position this living entity touched.

Source

fn set_last_climbable_pos(&self, pos: BlockPos)

Records the last climbable block position this living entity touched.

Source

fn default_living_on_climbable(&self) -> bool

Returns whether this entity is currently touching a climbable block; always false for spectators.

Source

fn should_discard_friction(&self) -> bool

Returns whether vanilla living travel should skip friction damping.

Source

fn set_discard_friction(&self, discard_friction: bool)

Sets whether vanilla living travel should skip friction damping.

Source

fn is_jumping(&self) -> bool

Returns whether this living entity is currently applying jump input.

Source

fn set_jumping(&self, jumping: bool)

Sets whether this living entity is currently applying jump input.

Source

fn travel_input(&self) -> LivingTravelInput

Returns vanilla living travel input.

Source

fn set_travel_input(&self, input: LivingTravelInput)

Sets vanilla living travel input.

Source

fn apply_input(&self)

Applies horizontal damping to the entity’s stored travel input for this tick.

Source

fn no_jump_delay(&self) -> i32

Returns vanilla jump cooldown ticks.

Source

fn set_no_jump_delay(&self, ticks: i32)

Sets vanilla jump cooldown ticks.

Source

fn tick_no_jump_delay(&self)

Decrements vanilla jump cooldown once per living AI step.

Source

fn hurt_time(&self) -> i32

returns the remaining hurt animation ticks

Source

fn default_is_immobile(&self) -> bool

Returns vanilla LivingEntity.isImmobile(). Returns whether this entity is immobile because it’s dead or dying.

Source

fn is_immobile(&self) -> bool

Returns whether this entity is currently immobile.

Source

fn apply_living_velocity_thresholds(&self)

Zeroes out velocity components too small to matter, using a stricter horizontal threshold for players than other entities.

Source

fn server_ai_step(&self, _entity: &SharedEntity)

Server AI hook called from vanilla LivingEntity.aiStep().

Source

fn get_jump_boost_power(&self) -> f32

Returns the jump-height bonus from the Jump Boost effect, scaling with amplifier.

Source

fn get_jump_power_with_multiplier(&self, multiplier: f32) -> f32

Returns jump velocity from the jump-strength attribute, scaled by multiplier, the standing block’s jump factor, and Jump Boost.

Source

fn get_jump_power(&self) -> f32

Returns this entity’s jump power at the default multiplier.

Source

fn default_jump_from_ground(&self)

Applies this entity’s jump velocity, unless jump power is negligible.

Source

fn jump_from_ground(&self)

Applies the entity’s jump velocity.

Source

fn go_down_in_water(&self)

Applies downward velocity while submerged and not jumping out of a liquid.

Source

fn jump_in_liquid(&self, _fluid_tag: &Identifier)

Applies upward velocity to jump out of the given liquid.

Source

fn handle_living_jump(&self)

Handles jump input each AI step: jumps from the ground when clear of jump delay, or jumps within water/lava when only partially submerged.

Source

fn tick_ridden(&self, _controller: &Player, _ridden_input: DVec3)

Ticks side effects of a rider controlling this entity, such as steering-based input.

Source

fn ridden_input(&self, _controller: &Player, self_input: DVec3) -> DVec3

Transforms the rider’s raw input into this entity’s movement input while ridden.

Source

fn ridden_speed(&self, _controller: &Player) -> f32

Returns the movement speed to use while being ridden.

Source

fn travel_ridden( &self, entity: &SharedEntity, controller: &Player, self_input: DVec3, ) -> Option<MoveResult>

Handles movement while this entity is being ridden and steered by a controlling player.

Source

fn default_ai_step(&self, entity: &SharedEntity) -> Option<MoveResult>

Default vanilla-shaped LivingEntity.aiStep() movement foundation for overrides.

This covers the shared travel state Steel currently has; mob AI and equipment ticking are still separate follow-up work.

Source

fn ai_step(&self, entity: &SharedEntity) -> Option<MoveResult>

Runs one AI-driven movement and effect tick for the entity.

Source

fn push_entities(&self)

Pushes nearby colliding entities away from this one.

Source

fn push_entities_in_order(&self, entities: &[SharedEntity])

Pushes against entities in the given order. The caller applies cramming damage first.

Source

fn apply_entity_cramming_damage( &self, world: &World, pushable_entities: &[SharedEntity], )

Applies vanilla max entity cramming damage from LivingEntity.pushEntities().

Source

fn is_suppressing_sliding_down_ladder(&self) -> bool

Returns whether this entity is suppressing sliding down a ladder (sneaking on one).

Source

fn levitation_travel_y_delta(&self, movement_y: f64) -> Option<f64>

Returns a levitation velocity adjustment for travelInAir.

Source

fn should_travel_in_fluid(&self, fluid_state: FluidState) -> bool

Returns whether movement should use fluid physics: currently in water or lava, affected by fluids, and unable to stand on this fluid.

Source

fn get_water_slow_down(&self) -> f32

Returns the water-movement slowdown multiplier.

Source

fn water_movement_efficiency(&self) -> f32

Returns the water movement efficiency attribute used by fluid travel.

Source

fn has_dolphins_grace(&self) -> bool

Returns whether dolphin’s grace should apply to water travel.

Source

fn get_flying_speed(&self) -> f32

Returns airborne movement speed: scaled from this entity’s speed when ridden by a player, otherwise a small constant.

Source

fn get_friction_influenced_speed(&self, block_friction: f32) -> f32

Returns movement speed adjusted by ground friction; airborne entities use flying speed instead.

Source

fn air_travel_vertical_friction(&self, _horizontal_friction: f32) -> f32

Returns the vertical friction used by travelInAir.

Source

fn handle_on_climbable(&self, movement: DVec3) -> DVec3

Clamps movement while on a climbable block: caps horizontal and downward speed, and resets fall distance; sneaking players holding on don’t slide down non-scaffolding ladders.

Source

fn apply_living_travel_gravity(&self)

Applies gravity using vanilla living-entity effective gravity.

Source

fn handle_relative_friction_and_calculate_movement( &self, entity: &SharedEntity, input: DVec3, block_friction: f32, ) -> Option<(DVec3, MoveResult)>

Applies friction-adjusted relative movement and returns the resulting velocity and move result.

Source

fn travel_in_air( &self, entity: &SharedEntity, input: DVec3, ) -> Option<MoveResult>

Handles movement, gravity, and air friction while the entity is airborne.

Source

fn get_fluid_falling_adjusted_movement( &self, base_gravity: f64, is_falling: bool, movement: DVec3, ) -> DVec3

Adjusts vertical movement while falling through a fluid to smooth the fall speed.

Source

fn jump_out_of_fluid(&self, old_y: f64)

Gives the entity an upward boost when it collides horizontally while rising out of a fluid.

Source

fn float_in_water_while_ridden(&self)

Applies buoyancy to keep a ridden entity afloat when it’s tagged to float while ridden.

Source

fn travel_in_water( &self, entity: &SharedEntity, input: DVec3, base_gravity: f64, is_falling: bool, old_y: f64, ) -> Option<MoveResult>

Handles movement, drag, and buoyancy effects while the entity is swimming in water.

Source

fn travel_in_lava( &self, entity: &SharedEntity, input: DVec3, base_gravity: f64, is_falling: bool, old_y: f64, ) -> Option<MoveResult>

Handles movement and drag effects while the entity is moving through lava.

Source

fn travel_in_fluid( &self, entity: &SharedEntity, input: DVec3, ) -> Option<MoveResult>

Dispatches fluid movement handling to the water or lava variant based on the current fluid.

Source

fn update_fall_flying(&self)

Mirrors the validation part of vanilla LivingEntity.updateFallFlying().

Source

fn update_fall_flying_movement(&self, movement: DVec3) -> DVec3

Computes the next movement vector for elytra gliding based on look direction and lift.

Source

fn stop_fall_flying(&self)

Toggles fall flying off, ending the elytra gliding state.

Source

fn handle_fall_flying_collisions( &self, previous_horizontal_speed: f64, new_horizontal_speed: f64, )

Applies fly-into-wall damage when a horizontal collision occurs while gliding.

Source

fn travel_fall_flying( &self, entity: &SharedEntity, input: DVec3, ) -> Option<MoveResult>

Handles movement, lift, and collision damage while the entity is gliding with an elytra.

Source

fn default_travel( &self, entity: &SharedEntity, input: DVec3, ) -> Option<MoveResult>

Dispatches movement to fluid, fall-flying, or air travel handling based on current state.

Source

fn travel(&self, entity: &SharedEntity, input: DVec3) -> Option<MoveResult>

Handles the entity’s self-driven movement for the current tick based on its input.

Source

fn sleeping_pos(&self) -> Option<BlockPos>

Returns the bed position that makes this living entity sleeping.

Source

fn set_sleeping_pos(&self, bed_position: BlockPos)

Sets the vanilla living-entity sleeping position.

Source

fn clear_sleeping_pos(&self)

Clears the vanilla living-entity sleeping position.

Source

fn is_sleeping(&self) -> bool

Checks if the entity is sleeping.

Source

fn living_synced_data(&self) -> Option<&dyn LivingEntitySyncedData>

Returns synchronized data specific to this living entity type, if any; None by default.

Source

fn start_sleeping(&self, bed_position: BlockPos) -> Result<(), EntityMoveError>

Starts sleeping at the given bed position.

Source

fn default_stop_sleeping(&self)

Shared body for overrides that need vanilla super.stopSleeping().

Source

fn stop_sleeping(&self)

Stops the entity from sleeping.

Source

fn is_sprinting(&self) -> bool

Checks if the entity is sprinting.

Source

fn set_sprinting(&self, sprinting: bool)

Sets whether the entity is sprinting.

Source

fn get_speed(&self) -> f32

Gets the entity’s cached movement speed.

Source

fn set_speed(&self, speed: f32)

Sets the entity’s cached movement speed.

Source

fn apply_post_impulse_grace_time(&self, ticks: i32)

Applies vanilla post-impulse movement validation grace.

Source

fn set_ignore_fall_damage_from_current_impulse( &self, ignore_fall_damage: bool, new_impulse_impact_pos: DVec3, )

Sets whether fall damage from the current knockback/impulse impact should be ignored.

Source

fn is_ignoring_fall_damage_from_current_impulse(&self) -> bool

Returns whether fall damage should currently be ignored due to a recent knockback/impulse impact.

Source

fn current_impulse_impact_pos(&self) -> Option<DVec3>

Returns the position of the most recent knockback/impulse impact, if still active.

Source

fn try_reset_current_impulse_context(&self)

Attempts to reset the current impulse context.

Source

fn reset_current_impulse_context(&self)

Resets the current impulse context.

Source

fn is_in_post_impulse_grace_time(&self) -> bool

Returns whether movement validation is inside post-impulse grace.

Source

fn tick_post_impulse_grace_time(&self)

Decrements post-impulse grace once per living-entity tick.

Source

fn refresh_dirty_attributes(&self)

Drains dirty attributes and applies server-side effects.

Source

fn random_teleport( &self, world: &Arc<World>, x: f64, y: f64, z: f64, broadcast: bool, ) -> bool

Returns true and commits the move on success, or false and leaves the entity untouched on failure.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§