pub trait LivingEntity: Entity {
Show 236 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 advance_attack_animation_for_base_tick(&self) { ... }
fn base_tick_living_entity(&self) { ... }
fn living_swing_state(&self) -> LivingSwingState { ... }
fn current_swing_duration(&self) -> i32 { ... }
fn swing(&self, hand: InteractionHand, update_self: bool) { ... }
fn update_swing_time(&self) { ... }
fn attributes(&self) -> &SyncMutex<AttributeMap> { ... }
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_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 sound_volume(&self) -> f32 { ... }
fn 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<DamageSource> { ... }
fn set_last_hurt_by_player(&self, player_uuid: Uuid, 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,
world: &World,
source: &DamageSource,
) { ... }
fn resolve_player_responsible_for_damage(
&self,
world: &World,
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 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 broadcast_hurt_animation(&self, world: &World) { ... }
fn die(&self, source: &DamageSource) { ... }
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_id: Option<i32>,
) -> i32 { ... }
fn drop_all_death_loot(&self, source: &DamageSource) { ... }
fn drop_experience(&self, world: &Arc<World>, killer_entity_id: Option<i32>) { ... }
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 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 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 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 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 on_equipped_item_broken(&self, 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) { ... }
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 default_is_immobile(&self) -> bool { ... }
fn is_immobile(&self) -> bool { ... }
fn apply_living_velocity_thresholds(&self) { ... }
fn server_ai_step(&self) { ... }
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,
controller: &Player,
self_input: DVec3,
) -> Option<MoveResult> { ... }
fn default_ai_step(&self) -> Option<MoveResult> { ... }
fn ai_step(&self) -> Option<MoveResult> { ... }
fn push_entities(&self) { ... }
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,
input: DVec3,
block_friction: f32,
) -> Option<(DVec3, MoveResult)> { ... }
fn travel_in_air(&self, 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,
input: DVec3,
base_gravity: f64,
is_falling: bool,
old_y: f64,
) -> Option<MoveResult> { ... }
fn travel_in_lava(
&self,
input: DVec3,
base_gravity: f64,
is_falling: bool,
old_y: f64,
) -> Option<MoveResult> { ... }
fn travel_in_fluid(&self, 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, input: DVec3) -> Option<MoveResult> { ... }
fn default_travel(&self, input: DVec3) -> Option<MoveResult> { ... }
fn travel(&self, 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 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) { ... }
}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§
Sourcefn living_base(&self) -> &LivingEntityBase
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.
Sourcefn get_health(&self) -> f32
fn get_health(&self) -> f32
Gets the current health of the entity.
Sourcefn set_health(&self, health: f32)
fn set_health(&self, health: f32)
Sets the health of the entity, clamped between 0 and max health.
Provided Methods§
Sourcefn living_rotation_state(&self) -> LivingRotationState
fn living_rotation_state(&self) -> LivingRotationState
Returns vanilla living body/head rotation state.
Sourcefn y_body_rot(&self) -> f32
fn y_body_rot(&self) -> f32
Returns vanilla LivingEntity.yBodyRot.
Sourcefn set_y_body_rot(&self, y_body_rot: f32)
fn set_y_body_rot(&self, y_body_rot: f32)
Sets vanilla LivingEntity.yBodyRot.
Sourcefn y_head_rot(&self) -> f32
fn y_head_rot(&self) -> f32
Returns vanilla LivingEntity.yHeadRot.
Sourcefn set_y_head_rot(&self, y_head_rot: f32)
fn set_y_head_rot(&self, y_head_rot: f32)
Sets vanilla LivingEntity.yHeadRot.
Sourcefn advance_living_rotation_for_base_tick(&self)
fn advance_living_rotation_for_base_tick(&self)
Copies current living body/head rotations to vanilla old-rotation state.
Sourcefn advance_attack_animation_for_base_tick(&self)
fn advance_attack_animation_for_base_tick(&self)
Copies current attack animation to vanilla old attack-animation state.
Sourcefn base_tick_living_entity(&self)
fn base_tick_living_entity(&self)
Runs vanilla LivingEntity.baseTick.
Sourcefn living_swing_state(&self) -> LivingSwingState
fn living_swing_state(&self) -> LivingSwingState
Returns vanilla arm-swing animation state.
Sourcefn current_swing_duration(&self) -> i32
fn current_swing_duration(&self) -> i32
Returns vanilla LivingEntity.getCurrentSwingDuration.
Sourcefn swing(&self, hand: InteractionHand, update_self: bool)
fn swing(&self, hand: InteractionHand, update_self: bool)
Runs vanilla LivingEntity.swing.
Sourcefn update_swing_time(&self)
fn update_swing_time(&self)
Runs vanilla LivingEntity.updateSwingTime.
Sourcefn attributes(&self) -> &SyncMutex<AttributeMap>
fn attributes(&self) -> &SyncMutex<AttributeMap>
Returns a reference to this entity’s attribute map.
Sourcefn pack_syncable_attributes(&self) -> Vec<AttributeSnapshot>
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.
Sourcefn drain_dirty_syncable_attributes(&self) -> Vec<AttributeSnapshot>
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.
Sourcefn drain_dirty_mob_effects(&self) -> Vec<MobEffectSyncChange>
fn drain_dirty_mob_effects(&self) -> Vec<MobEffectSyncChange>
Drains dirty mob-effect packet changes for vanilla recipients.
Sourcefn pack_all_equipment(&self) -> Vec<EquipmentSlotItem>
fn pack_all_equipment(&self) -> Vec<EquipmentSlotItem>
Packs non-empty equipment slots for initial spawn pairing.
Sourcefn drain_dirty_equipment(&self) -> Vec<EquipmentSlotItem>
fn drain_dirty_equipment(&self) -> Vec<EquipmentSlotItem>
Drains equipment slots that changed since the last tracker sync.
Sourcefn save_command_nbt(&self, nbt: &mut NbtCompound)
fn save_command_nbt(&self, nbt: &mut NbtCompound)
Appends vanilla-shaped living state used by command NBT predicates.
Sourcefn get_max_health(&self) -> f32
fn get_max_health(&self) -> f32
Gets the maximum health from the attribute system.
Sourcefn no_action_time(&self) -> i32
fn no_action_time(&self) -> i32
Returns vanilla LivingEntity.noActionTime.
Sourcefn set_no_action_time(&self, no_action_time: i32)
fn set_no_action_time(&self, no_action_time: i32)
Sets vanilla LivingEntity.noActionTime.
Sourcefn increment_no_action_time(&self)
fn increment_no_action_time(&self)
Increments vanilla LivingEntity.noActionTime.
Sourcefn is_dead_or_dying(&self) -> bool
fn is_dead_or_dying(&self) -> bool
Returns true if the entity is dead or dying (health <= 0).
Sourcefn sound_volume(&self) -> f32
fn sound_volume(&self) -> f32
Returns vanilla LivingEntity.getSoundVolume.
Sourcefn voice_pitch(&self) -> f32
fn voice_pitch(&self) -> f32
Returns vanilla LivingEntity.getVoicePitch.
Sourcefn hurt_sound(&self, _source: &DamageSource) -> Option<SoundEventRef>
fn hurt_sound(&self, _source: &DamageSource) -> Option<SoundEventRef>
Returns vanilla LivingEntity.getHurtSound.
Sourcefn death_sound(&self) -> Option<SoundEventRef>
fn death_sound(&self) -> Option<SoundEventRef>
Returns vanilla LivingEntity.getDeathSound.
Sourcefn make_sound(&self, sound: Option<SoundEventRef>)
fn make_sound(&self, sound: Option<SoundEventRef>)
Runs vanilla LivingEntity.makeSound.
Sourcefn play_hurt_sound(&self, source: &DamageSource)
fn play_hurt_sound(&self, source: &DamageSource)
Runs vanilla LivingEntity.playHurtSound.
Sourcefn play_death_sound(&self)
fn play_death_sound(&self)
Plays vanilla’s death sound for this living entity.
Sourcefn get_age_scale(&self) -> f32
fn get_age_scale(&self) -> f32
Returns vanilla LivingEntity.getAgeScale().
Sourcefn get_armor_cover_percentage(&self) -> f32
fn get_armor_cover_percentage(&self) -> f32
Returns vanilla LivingEntity.getArmorCoverPercentage().
Sourcefn get_visibility_percent(&self, targeting_entity: Option<&dyn Entity>) -> f64
fn get_visibility_percent(&self, targeting_entity: Option<&dyn Entity>) -> f64
Returns vanilla LivingEntity.getVisibilityPercent().
Sourcefn disguise_head_matches_targeting_entity(
&self,
targeting_entity: Option<&dyn Entity>,
) -> bool
fn disguise_head_matches_targeting_entity( &self, targeting_entity: Option<&dyn Entity>, ) -> bool
Returns whether the equipped head item reduces visibility to targeting_entity.
Sourcefn can_be_seen_by_anyone(&self) -> bool
fn can_be_seen_by_anyone(&self) -> bool
Returns vanilla LivingEntity.canBeSeenByAnyone().
Sourcefn can_be_seen_as_enemy(&self) -> bool
fn can_be_seen_as_enemy(&self) -> bool
Returns vanilla LivingEntity.canBeSeenAsEnemy().
Sourcefn can_attack(&self, target: &dyn LivingEntity) -> bool
fn can_attack(&self, target: &dyn LivingEntity) -> bool
Returns vanilla LivingEntity.canAttack().
Sourcefn last_damage_source(&self) -> Option<DamageSource>
fn last_damage_source(&self) -> Option<DamageSource>
Returns vanilla LivingEntity.getLastDamageSource().
Sourcefn set_last_hurt_by_player(&self, player_uuid: Uuid, time_to_remember: i32)
fn set_last_hurt_by_player(&self, player_uuid: Uuid, time_to_remember: i32)
Sets vanilla LivingEntity.lastHurtByPlayer.
Sourcefn last_hurt_by_player_memory_time(&self) -> i32
fn last_hurt_by_player_memory_time(&self) -> i32
Returns vanilla LivingEntity.lastHurtByPlayerMemoryTime.
Sourcefn last_hurt_by_player_uuid(&self) -> Option<Uuid>
fn last_hurt_by_player_uuid(&self) -> Option<Uuid>
Returns vanilla LivingEntity.lastHurtByPlayer, if still remembered.
Sourcefn last_hurt_by_mob(&self) -> Option<SharedEntity>
fn last_hurt_by_mob(&self) -> Option<SharedEntity>
Returns vanilla LivingEntity.lastHurtByMob.
Sourcefn last_hurt_by_mob_timestamp(&self) -> i32
fn last_hurt_by_mob_timestamp(&self) -> i32
Returns vanilla LivingEntity.lastHurtByMobTimestamp.
Sourcefn set_last_hurt_by_mob(&self, target: Option<&SharedEntity>)
fn set_last_hurt_by_mob(&self, target: Option<&SharedEntity>)
Sets vanilla LivingEntity.lastHurtByMob.
Sourcefn last_hurt_mob(&self) -> Option<SharedEntity>
fn last_hurt_mob(&self) -> Option<SharedEntity>
Returns vanilla LivingEntity.lastHurtMob.
Sourcefn last_hurt_mob_timestamp(&self) -> i32
fn last_hurt_mob_timestamp(&self) -> i32
Returns vanilla LivingEntity.lastHurtMobTimestamp.
Sourcefn set_last_hurt_mob(&self, target: Option<&SharedEntity>)
fn set_last_hurt_mob(&self, target: Option<&SharedEntity>)
Sets vanilla LivingEntity.lastHurtMob.
Sourcefn resolve_mob_responsible_for_damage(
&self,
world: &World,
source: &DamageSource,
)
fn resolve_mob_responsible_for_damage( &self, world: &World, source: &DamageSource, )
Resolves vanilla LivingEntity.resolveMobResponsibleForDamage.
Sourcefn resolve_player_responsible_for_damage(
&self,
world: &World,
source: &DamageSource,
)
fn resolve_player_responsible_for_damage( &self, world: &World, source: &DamageSource, )
Resolves vanilla LivingEntity.resolvePlayerResponsibleForDamage.
Sourcefn has_line_of_sight(&self, target: &dyn Entity) -> bool
fn has_line_of_sight(&self, target: &dyn Entity) -> bool
Returns vanilla LivingEntity.hasLineOfSight().
Sourcefn has_line_of_sight_with(
&self,
target: &dyn Entity,
block_shape: ClipBlockShape,
fluid: ClipFluid,
target_eye_y: f64,
) -> bool
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.
Sourcefn default_is_invulnerable_to(&self, source: &DamageSource) -> bool
fn default_is_invulnerable_to(&self, source: &DamageSource) -> bool
Returns vanilla base living-entity invulnerability.
Sourcefn is_invulnerable_to(&self, world: &World, source: &DamageSource) -> bool
fn is_invulnerable_to(&self, world: &World, source: &DamageSource) -> bool
Returns whether this living entity ignores a damage source.
Sourcefn hurt_server(&self, world: &World, source: &DamageSource, amount: f32) -> bool
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.
Sourcefn before_actually_hurt(&self, _source: &DamageSource, _amount: f32)
fn before_actually_hurt(&self, _source: &DamageSource, _amount: f32)
Hook before applying damage after vanilla reductions.
Sourcefn hurt_armor(&self, _source: &DamageSource, _damage: f32)
fn hurt_armor(&self, _source: &DamageSource, _damage: f32)
Damages equipment that participates in vanilla armor absorption.
Sourcefn do_hurt_equipment(
&self,
source: &DamageSource,
damage: f32,
slots: &[EquipmentSlot],
)
fn do_hurt_equipment( &self, source: &DamageSource, damage: f32, slots: &[EquipmentSlot], )
Mirrors vanilla LivingEntity.doHurtEquipment.
Sourcefn get_damage_after_armor_absorb(
&self,
source: &DamageSource,
damage: f32,
) -> f32
fn get_damage_after_armor_absorb( &self, source: &DamageSource, damage: f32, ) -> f32
Mirrors vanilla LivingEntity.getDamageAfterArmorAbsorb.
Sourcefn get_damage_after_magic_absorb(
&self,
source: &DamageSource,
damage: f32,
) -> f32
fn get_damage_after_magic_absorb( &self, source: &DamageSource, damage: f32, ) -> f32
Mirrors vanilla LivingEntity.getDamageAfterMagicAbsorb.
Sourcefn actually_hurt(&self, world: &World, source: &DamageSource, amount: f32)
fn actually_hurt(&self, world: &World, source: &DamageSource, amount: f32)
Applies damage after vanilla reductions.
Sourcefn apply_damage_knockback(&self, source: &DamageSource)
fn apply_damage_knockback(&self, source: &DamageSource)
Applies vanilla hurt knockback for a damage source.
Sourcefn damage_knockback_direction(&self, source: &DamageSource) -> (f64, f64)
fn damage_knockback_direction(&self, source: &DamageSource) -> (f64, f64)
Returns the horizontal direction used by vanilla damage knockback.
Sourcefn knockback_resistance(&self) -> f64
fn knockback_resistance(&self) -> f64
Returns vanilla knockback resistance.
Sourcefn indicate_damage(&self, _xd: f64, _zd: f64)
fn indicate_damage(&self, _xd: f64, _zd: f64)
Mirrors vanilla LivingEntity.indicateDamage.
Sourcefn hurt_broadcast_chunk(&self) -> ChunkPos
fn hurt_broadcast_chunk(&self) -> ChunkPos
Returns the chunk used for vanilla nearby hurt broadcasts.
Sourcefn broadcast_damage_event(&self, world: &World, source: &DamageSource)
fn broadcast_damage_event(&self, world: &World, source: &DamageSource)
Broadcasts vanilla damage-event metadata near this entity.
Sourcefn broadcast_hurt_animation(&self, world: &World)
fn broadcast_hurt_animation(&self, world: &World)
Broadcasts vanilla hurt animation near this entity.
Sourcefn die(&self, source: &DamageSource)
fn die(&self, source: &DamageSource)
Processes vanilla living death side effects.
Sourcefn should_drop_loot(&self, world: &World) -> bool
fn should_drop_loot(&self, world: &World) -> bool
Returns vanilla LivingEntity.shouldDropLoot.
Sourcefn should_drop_experience(&self) -> bool
fn should_drop_experience(&self) -> bool
Returns vanilla LivingEntity.shouldDropExperience.
Sourcefn is_always_experience_dropper(&self) -> bool
fn is_always_experience_dropper(&self) -> bool
Returns vanilla LivingEntity.isAlwaysExperienceDropper.
Sourcefn skip_drop_experience(&self)
fn skip_drop_experience(&self)
Runs vanilla LivingEntity.skipDropExperience.
Sourcefn was_experience_consumed(&self) -> bool
fn was_experience_consumed(&self) -> bool
Returns vanilla LivingEntity.wasExperienceConsumed.
Sourcefn base_experience_reward(&self) -> i32
fn base_experience_reward(&self) -> i32
Returns vanilla LivingEntity.getBaseExperienceReward.
Sourcefn experience_reward(
&self,
_world: &World,
_killer_entity_id: Option<i32>,
) -> i32
fn experience_reward( &self, _world: &World, _killer_entity_id: Option<i32>, ) -> i32
Returns vanilla LivingEntity.getExperienceReward.
Sourcefn drop_all_death_loot(&self, source: &DamageSource)
fn drop_all_death_loot(&self, source: &DamageSource)
Runs the currently implemented subset of vanilla LivingEntity.dropAllDeathLoot.
Sourcefn drop_experience(&self, world: &Arc<World>, killer_entity_id: Option<i32>)
fn drop_experience(&self, world: &Arc<World>, killer_entity_id: Option<i32>)
Runs vanilla LivingEntity.dropExperience.
Sourcefn death_loot_table(&self) -> Option<LootTableRef>
fn death_loot_table(&self) -> Option<LootTableRef>
Resolves the loot table used by vanilla LivingEntity.dropFromLootTable.
Sourcefn death_loot_table_seed(&self) -> i64
fn death_loot_table_seed(&self) -> i64
Returns vanilla Entity.getLootTableSeed for death loot.
Sourcefn drop_from_loot_table(&self, source: &DamageSource, killed_by_player: bool)
fn drop_from_loot_table(&self, source: &DamageSource, killed_by_player: bool)
Runs vanilla LivingEntity.dropFromLootTable.
Sourcefn drop_custom_death_loot(
&self,
_source: &DamageSource,
_killed_by_player: bool,
)
fn drop_custom_death_loot( &self, _source: &DamageSource, _killed_by_player: bool, )
Hook for non-mob custom death loot.
Sourcefn tick_death(&self)
fn tick_death(&self)
Ticks the vanilla living death animation and removes the entity at completion.
Sourcefn get_absorption_amount(&self) -> f32
fn get_absorption_amount(&self) -> f32
Gets the absorption amount (extra health from effects like absorption).
Sourcefn set_absorption_amount(&self, amount: f32)
fn set_absorption_amount(&self, amount: f32)
Sets the absorption amount.
Sourcefn fall_damage_sound(&self, damage: i32) -> SoundEventRef
fn fall_damage_sound(&self, damage: i32) -> SoundEventRef
Returns vanilla LivingEntity.getFallDamageSound().
Sourcefn play_block_fall_sound(&self)
fn play_block_fall_sound(&self)
Plays vanilla LivingEntity.playBlockFallSound().
Sourcefn cause_living_fall_damage(
&self,
fall_distance: f64,
damage_modifier: f32,
source: &DamageSource,
) -> bool
fn cause_living_fall_damage( &self, fall_distance: f64, damage_modifier: f32, source: &DamageSource, ) -> bool
Mirrors vanilla LivingEntity.causeFallDamage.
Sourcefn get_armor_value(&self) -> i32
fn get_armor_value(&self) -> i32
Gets the entity’s armor value from the attribute system.
Sourcefn get_attribute_gravity(&self) -> f64
fn get_attribute_gravity(&self) -> f64
Gets the gravity value from the attribute system.
Sourcefn get_effective_gravity(&self) -> f64
fn get_effective_gravity(&self) -> f64
Returns vanilla LivingEntity.getEffectiveGravity().
Sourcefn is_affected_by_potions(&self) -> bool
fn is_affected_by_potions(&self) -> bool
Checks if the entity can be affected by potions.
Sourcefn default_can_be_affected(&self, effect: &MobEffectInstance) -> bool
fn default_can_be_affected(&self, effect: &MobEffectInstance) -> bool
Returns vanilla base LivingEntity.canBeAffected eligibility.
Sourcefn can_be_affected(&self, effect: &MobEffectInstance) -> bool
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.
Sourcefn has_mob_effect(&self, effect: MobEffectRef) -> bool
fn has_mob_effect(&self, effect: MobEffectRef) -> bool
Returns vanilla LivingEntity.hasEffect().
Sourcefn mob_effect(&self, effect: MobEffectRef) -> Option<ActiveMobEffect>
fn mob_effect(&self, effect: MobEffectRef) -> Option<ActiveMobEffect>
Returns vanilla LivingEntity.getEffect().
Sourcefn active_mob_effects(&self) -> Vec<ActiveMobEffect> ⓘ
fn active_mob_effects(&self) -> Vec<ActiveMobEffect> ⓘ
Returns all active vanilla mob effects.
Sourcefn set_mob_effect(&self, effect: MobEffectRef, amplifier: i32)
fn set_mob_effect(&self, effect: MobEffectRef, amplifier: i32)
Sets active vanilla mob-effect state.
Sourcefn add_mob_effect(&self, effect: MobEffectInstance) -> bool
fn add_mob_effect(&self, effect: MobEffectInstance) -> bool
Adds or updates active vanilla mob-effect state.
Sourcefn set_mob_effect_active(&self, effect: MobEffectRef, active: bool)
fn set_mob_effect_active(&self, effect: MobEffectRef, active: bool)
Sets the presence of a vanilla mob effect.
Sourcefn remove_mob_effect(&self, effect: MobEffectRef) -> bool
fn remove_mob_effect(&self, effect: MobEffectRef) -> bool
Removes active vanilla mob-effect state.
Sourcefn tick_mob_effects(&self)
fn tick_mob_effects(&self)
Ticks vanilla server-side mob-effect behavior and durations.
Sourcefn has_water_breathing(&self) -> bool
fn has_water_breathing(&self) -> bool
Returns whether vanilla effects keep this entity from drowning.
Sourcefn should_effects_refill_air_supply(&self) -> bool
fn should_effects_refill_air_supply(&self) -> bool
Returns whether active vanilla effects refill this entity’s air supply.
Sourcefn can_breathe_underwater(&self) -> bool
fn can_breathe_underwater(&self) -> bool
Returns vanilla LivingEntity.canBreatheUnderwater.
Sourcefn can_drown_in_water(&self) -> bool
fn can_drown_in_water(&self) -> bool
Returns whether this entity can lose air and take drowning damage.
Sourcefn is_eye_in_bubble_column(&self) -> bool
fn is_eye_in_bubble_column(&self) -> bool
Returns whether the entity’s eye block is a bubble column.
Sourcefn decrease_air_supply(&self, current_supply: i32) -> i32
fn decrease_air_supply(&self, current_supply: i32) -> i32
Mirrors vanilla LivingEntity.decreaseAirSupply.
Sourcefn increase_air_supply(&self, current_supply: i32) -> i32
fn increase_air_supply(&self, current_supply: i32) -> i32
Mirrors vanilla LivingEntity.increaseAirSupply.
Sourcefn should_take_drowning_damage(&self) -> bool
fn should_take_drowning_damage(&self) -> bool
Mirrors vanilla LivingEntity.shouldTakeDrowningDamage.
Sourcefn tick_living_air_supply(&self)
fn tick_living_air_supply(&self)
Ticks vanilla living air-supply and drowning behavior from baseTick.
Sourcefn is_in_wall(&self) -> bool
fn is_in_wall(&self) -> bool
Mirrors vanilla LivingEntity.isInWall.
Sourcefn tick_in_wall_damage(&self)
fn tick_in_wall_damage(&self)
Applies vanilla living in-wall damage from baseTick.
Sourcefn tick_living_environmental_damage(&self)
fn tick_living_environmental_damage(&self)
Applies vanilla living environmental damage in LivingEntity.baseTick order.
Sourcefn is_affected_by_fluids(&self) -> bool
fn is_affected_by_fluids(&self) -> bool
Returns vanilla LivingEntity.isAffectedByFluids().
Sourcefn can_stand_on_fluid(&self, _fluid_state: FluidState) -> bool
fn can_stand_on_fluid(&self, _fluid_state: FluidState) -> bool
Returns vanilla LivingEntity.canStandOnFluid().
Sourcefn is_using_item(&self) -> bool
fn is_using_item(&self) -> bool
Checks if the entity is currently using an item.
Sourcefn is_blocking(&self) -> bool
fn is_blocking(&self) -> bool
Checks if the entity is blocking with a shield or similar item.
Sourcefn is_fall_flying(&self) -> bool
fn is_fall_flying(&self) -> bool
Checks if the entity is fall flying (using elytra).
Sourcefn set_fall_flying(&self, fall_flying: bool)
fn set_fall_flying(&self, fall_flying: bool)
Sets whether this entity is fall flying.
Sourcefn fall_flying_ticks(&self) -> i32
fn fall_flying_ticks(&self) -> i32
Returns vanilla LivingEntity.getFallFlyingTicks().
Sourcefn with_equipment_slot(
&self,
slot: EquipmentSlot,
visitor: &mut dyn FnMut(&ItemStack),
)
fn with_equipment_slot( &self, slot: EquipmentSlot, visitor: &mut dyn FnMut(&ItemStack), )
Visits the item in a vanilla living-entity equipment slot.
Sourcefn is_holding(&self, predicate: &mut dyn FnMut(&ItemStack) -> bool) -> bool
fn is_holding(&self, predicate: &mut dyn FnMut(&ItemStack) -> bool) -> bool
Returns vanilla LivingEntity.isHolding.
Sourcefn with_equipment_slot_mut(
&self,
slot: EquipmentSlot,
visitor: &mut dyn FnMut(&mut ItemStack),
)
fn with_equipment_slot_mut( &self, slot: EquipmentSlot, visitor: &mut dyn FnMut(&mut ItemStack), )
Mutates the item in a vanilla living-entity equipment slot.
Sourcefn has_item_in_slot(&self, slot: EquipmentSlot) -> bool
fn has_item_in_slot(&self, slot: EquipmentSlot) -> bool
Returns whether this entity currently has an item in slot.
Sourcefn can_use_slot(&self, _slot: EquipmentSlot) -> bool
fn can_use_slot(&self, _slot: EquipmentSlot) -> bool
Returns whether vanilla allows this entity to use slot.
Sourcefn can_dispenser_equip_into_slot(&self, _slot: EquipmentSlot) -> bool
fn can_dispenser_equip_into_slot(&self, _slot: EquipmentSlot) -> bool
Returns the effective vanilla dispenser slot gate for living entities and mobs.
Sourcefn can_equip_with_dispenser(&self, item_stack: &ItemStack) -> bool
fn can_equip_with_dispenser(&self, item_stack: &ItemStack) -> bool
Returns vanilla LivingEntity.canEquipWithDispenser.
Sourcefn is_equippable_in_slot(
&self,
item_stack: &ItemStack,
slot: EquipmentSlot,
) -> bool
fn is_equippable_in_slot( &self, item_stack: &ItemStack, slot: EquipmentSlot, ) -> bool
Returns vanilla LivingEntity.isEquippableInSlot.
Sourcefn equip_sound(
&self,
slot: EquipmentSlot,
stack: &ItemStack,
) -> Option<SoundEventRef>
fn equip_sound( &self, slot: EquipmentSlot, stack: &ItemStack, ) -> Option<SoundEventRef>
Returns the equip sound Steel can currently resolve for this entity.
Sourcefn interact_living_entity_with_equippable(
&self,
player: &Player,
hand: InteractionHand,
) -> InteractionResult
fn interact_living_entity_with_equippable( &self, player: &Player, hand: InteractionHand, ) -> InteractionResult
Runs vanilla’s equippable ItemStack.interactLivingEntity branch.
Sourcefn refresh_equipment_attribute_modifiers(&self, slot: EquipmentSlot)
fn refresh_equipment_attribute_modifiers(&self, slot: EquipmentSlot)
Refreshes transient item attribute modifiers for one equipment slot.
Sourcefn detect_equipment_updates(&self)
fn detect_equipment_updates(&self)
Detects and applies Vanilla living-equipment changes once per tick.
Sourcefn pack_living_equipment(&self) -> Vec<EquipmentSlotItem>
fn pack_living_equipment(&self) -> Vec<EquipmentSlotItem>
Packs non-empty living equipment slots for initial spawn pairing.
Sourcefn drain_dirty_living_equipment(&self) -> Vec<EquipmentSlotItem>
fn drain_dirty_living_equipment(&self) -> Vec<EquipmentSlotItem>
Drains dirty living equipment slots for tracker sync.
Sourcefn has_infinite_materials(&self) -> bool
fn has_infinite_materials(&self) -> bool
Returns whether equipment durability should be skipped for this entity.
Sourcefn on_equipped_item_broken(&self, slot: EquipmentSlot)
fn on_equipped_item_broken(&self, slot: EquipmentSlot)
Called after an equipped item breaks.
Sourcefn default_living_can_freeze(&self) -> bool
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.
Sourcefn is_on_non_air_block_for_frost(&self) -> bool
fn is_on_non_air_block_for_frost(&self) -> bool
Returns whether vanilla tryAddFrost sees a non-air block below.
Sourcefn remove_frost(&self)
fn remove_frost(&self)
Mirrors vanilla LivingEntity.removeFrost.
Sourcefn try_add_frost(&self)
fn try_add_frost(&self)
Mirrors vanilla LivingEntity.tryAddFrost.
Sourcefn tick_freezing(&self)
fn tick_freezing(&self)
Ticks vanilla LivingEntity.aiStep freezing effects.
Sourcefn tick_living_entity(&self)
fn tick_living_entity(&self)
Runs vanilla LivingEntity.tick.
The default Entity::tick dispatches living entities here.
Sourcefn tick_living_state(&self)
fn tick_living_state(&self)
Ticks living-entity counters after movement.
Sourcefn can_glide_using(&self, item_stack: &ItemStack, slot: EquipmentSlot) -> bool
fn can_glide_using(&self, item_stack: &ItemStack, slot: EquipmentSlot) -> bool
Mirrors vanilla LivingEntity.canGlideUsing().
Sourcefn can_glide_using_equipment_slot(&self, slot: EquipmentSlot) -> bool
fn can_glide_using_equipment_slot(&self, slot: EquipmentSlot) -> bool
Returns whether the item in slot can be used for vanilla gliding.
Sourcefn damage_random_glider(&self)
fn damage_random_glider(&self)
Damages one random equipped glider like vanilla LivingEntity.updateFallFlying().
Sourcefn default_can_glide(&self) -> bool
fn default_can_glide(&self) -> bool
Default vanilla LivingEntity.canGlide() implementation for overrides.
Sourcefn start_fall_flying(&self)
fn start_fall_flying(&self)
Mirrors vanilla Player.startFallFlying().
Sourcefn try_to_start_fall_flying(&self) -> bool
fn try_to_start_fall_flying(&self) -> bool
Mirrors vanilla Player.tryToStartFallFlying().
Sourcefn last_climbable_pos(&self) -> Option<BlockPos>
fn last_climbable_pos(&self) -> Option<BlockPos>
Returns the last climbable block position this living entity touched.
Sourcefn set_last_climbable_pos(&self, pos: BlockPos)
fn set_last_climbable_pos(&self, pos: BlockPos)
Records the last climbable block position this living entity touched.
Sourcefn default_living_on_climbable(&self) -> bool
fn default_living_on_climbable(&self) -> bool
Returns vanilla LivingEntity.onClimbable() behavior.
Sourcefn should_discard_friction(&self) -> bool
fn should_discard_friction(&self) -> bool
Returns whether vanilla living travel should skip friction damping.
Sourcefn set_discard_friction(&self, discard_friction: bool)
fn set_discard_friction(&self, discard_friction: bool)
Sets whether vanilla living travel should skip friction damping.
Sourcefn is_jumping(&self) -> bool
fn is_jumping(&self) -> bool
Returns whether this living entity is currently applying jump input.
Sourcefn set_jumping(&self, jumping: bool)
fn set_jumping(&self, jumping: bool)
Sets whether this living entity is currently applying jump input.
Sourcefn travel_input(&self) -> LivingTravelInput
fn travel_input(&self) -> LivingTravelInput
Returns vanilla living travel input.
Sourcefn set_travel_input(&self, input: LivingTravelInput)
fn set_travel_input(&self, input: LivingTravelInput)
Sets vanilla living travel input.
Sourcefn apply_input(&self)
fn apply_input(&self)
Applies vanilla LivingEntity.applyInput() damping.
Sourcefn no_jump_delay(&self) -> i32
fn no_jump_delay(&self) -> i32
Returns vanilla jump cooldown ticks.
Sourcefn set_no_jump_delay(&self, ticks: i32)
fn set_no_jump_delay(&self, ticks: i32)
Sets vanilla jump cooldown ticks.
Sourcefn tick_no_jump_delay(&self)
fn tick_no_jump_delay(&self)
Decrements vanilla jump cooldown once per living AI step.
Sourcefn default_is_immobile(&self) -> bool
fn default_is_immobile(&self) -> bool
Returns vanilla LivingEntity.isImmobile().
Sourcefn is_immobile(&self) -> bool
fn is_immobile(&self) -> bool
Returns vanilla LivingEntity.isImmobile().
Sourcefn apply_living_velocity_thresholds(&self)
fn apply_living_velocity_thresholds(&self)
Applies vanilla LivingEntity.aiStep() velocity thresholds.
Sourcefn server_ai_step(&self)
fn server_ai_step(&self)
Server AI hook called from vanilla LivingEntity.aiStep().
Sourcefn get_jump_boost_power(&self) -> f32
fn get_jump_boost_power(&self) -> f32
Returns vanilla LivingEntity.getJumpBoostPower().
Sourcefn get_jump_power_with_multiplier(&self, multiplier: f32) -> f32
fn get_jump_power_with_multiplier(&self, multiplier: f32) -> f32
Returns vanilla LivingEntity.getJumpPower(float).
Sourcefn get_jump_power(&self) -> f32
fn get_jump_power(&self) -> f32
Returns vanilla LivingEntity.getJumpPower().
Sourcefn default_jump_from_ground(&self)
fn default_jump_from_ground(&self)
Default vanilla LivingEntity.jumpFromGround() implementation for overrides.
Sourcefn jump_from_ground(&self)
fn jump_from_ground(&self)
Mirrors vanilla LivingEntity.jumpFromGround().
Sourcefn go_down_in_water(&self)
fn go_down_in_water(&self)
Mirrors vanilla LivingEntity.goDownInWater().
Sourcefn jump_in_liquid(&self, _fluid_tag: &Identifier)
fn jump_in_liquid(&self, _fluid_tag: &Identifier)
Mirrors vanilla LivingEntity.jumpInLiquid().
Sourcefn handle_living_jump(&self)
fn handle_living_jump(&self)
Applies vanilla LivingEntity.aiStep() jump handling.
Sourcefn tick_ridden(&self, _controller: &Player, _ridden_input: DVec3)
fn tick_ridden(&self, _controller: &Player, _ridden_input: DVec3)
Mirrors vanilla LivingEntity.tickRidden().
Sourcefn ridden_input(&self, _controller: &Player, self_input: DVec3) -> DVec3
fn ridden_input(&self, _controller: &Player, self_input: DVec3) -> DVec3
Mirrors vanilla LivingEntity.getRiddenInput().
Sourcefn ridden_speed(&self, _controller: &Player) -> f32
fn ridden_speed(&self, _controller: &Player) -> f32
Mirrors vanilla LivingEntity.getRiddenSpeed().
Sourcefn travel_ridden(
&self,
controller: &Player,
self_input: DVec3,
) -> Option<MoveResult>
fn travel_ridden( &self, controller: &Player, self_input: DVec3, ) -> Option<MoveResult>
Mirrors vanilla LivingEntity.travelRidden().
Sourcefn default_ai_step(&self) -> Option<MoveResult>
fn default_ai_step(&self) -> 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.
Sourcefn ai_step(&self) -> Option<MoveResult>
fn ai_step(&self) -> Option<MoveResult>
Mirrors vanilla LivingEntity.aiStep().
Sourcefn push_entities(&self)
fn push_entities(&self)
Mirrors vanilla LivingEntity.pushEntities().
Sourcefn apply_entity_cramming_damage(
&self,
world: &World,
pushable_entities: &[SharedEntity],
)
fn apply_entity_cramming_damage( &self, world: &World, pushable_entities: &[SharedEntity], )
Applies vanilla max entity cramming damage from LivingEntity.pushEntities().
Sourcefn is_suppressing_sliding_down_ladder(&self) -> bool
fn is_suppressing_sliding_down_ladder(&self) -> bool
Returns vanilla LivingEntity.isSuppressingSlidingDownLadder().
Sourcefn levitation_travel_y_delta(&self, movement_y: f64) -> Option<f64>
fn levitation_travel_y_delta(&self, movement_y: f64) -> Option<f64>
Returns a levitation velocity adjustment for travelInAir.
Sourcefn should_travel_in_fluid(&self, fluid_state: FluidState) -> bool
fn should_travel_in_fluid(&self, fluid_state: FluidState) -> bool
Returns whether vanilla LivingEntity.travel() should use fluid movement.
Sourcefn get_water_slow_down(&self) -> f32
fn get_water_slow_down(&self) -> f32
Returns vanilla LivingEntity.getWaterSlowDown().
Sourcefn water_movement_efficiency(&self) -> f32
fn water_movement_efficiency(&self) -> f32
Returns the water movement efficiency attribute used by fluid travel.
Sourcefn has_dolphins_grace(&self) -> bool
fn has_dolphins_grace(&self) -> bool
Returns whether dolphin’s grace should apply to water travel.
Sourcefn get_flying_speed(&self) -> f32
fn get_flying_speed(&self) -> f32
Returns vanilla LivingEntity.getFlyingSpeed().
Sourcefn get_friction_influenced_speed(&self, block_friction: f32) -> f32
fn get_friction_influenced_speed(&self, block_friction: f32) -> f32
Returns vanilla LivingEntity.getFrictionInfluencedSpeed().
Sourcefn air_travel_vertical_friction(&self, _horizontal_friction: f32) -> f32
fn air_travel_vertical_friction(&self, _horizontal_friction: f32) -> f32
Returns the vertical friction used by travelInAir.
Sourcefn handle_on_climbable(&self, movement: DVec3) -> DVec3
fn handle_on_climbable(&self, movement: DVec3) -> DVec3
Applies vanilla LivingEntity.handleOnClimbable().
Sourcefn apply_living_travel_gravity(&self)
fn apply_living_travel_gravity(&self)
Applies gravity using vanilla living-entity effective gravity.
Sourcefn handle_relative_friction_and_calculate_movement(
&self,
input: DVec3,
block_friction: f32,
) -> Option<(DVec3, MoveResult)>
fn handle_relative_friction_and_calculate_movement( &self, input: DVec3, block_friction: f32, ) -> Option<(DVec3, MoveResult)>
Mirrors vanilla LivingEntity.handleRelativeFrictionAndCalculateMovement().
Sourcefn travel_in_air(&self, input: DVec3) -> Option<MoveResult>
fn travel_in_air(&self, input: DVec3) -> Option<MoveResult>
Mirrors vanilla LivingEntity.travelInAir().
Sourcefn get_fluid_falling_adjusted_movement(
&self,
base_gravity: f64,
is_falling: bool,
movement: DVec3,
) -> DVec3
fn get_fluid_falling_adjusted_movement( &self, base_gravity: f64, is_falling: bool, movement: DVec3, ) -> DVec3
Mirrors vanilla LivingEntity.getFluidFallingAdjustedMovement().
Sourcefn jump_out_of_fluid(&self, old_y: f64)
fn jump_out_of_fluid(&self, old_y: f64)
Mirrors vanilla LivingEntity.jumpOutOfFluid().
Sourcefn float_in_water_while_ridden(&self)
fn float_in_water_while_ridden(&self)
Mirrors vanilla LivingEntity.floatInWaterWhileRidden().
Sourcefn travel_in_water(
&self,
input: DVec3,
base_gravity: f64,
is_falling: bool,
old_y: f64,
) -> Option<MoveResult>
fn travel_in_water( &self, input: DVec3, base_gravity: f64, is_falling: bool, old_y: f64, ) -> Option<MoveResult>
Mirrors vanilla LivingEntity.travelInWater().
Sourcefn travel_in_lava(
&self,
input: DVec3,
base_gravity: f64,
is_falling: bool,
old_y: f64,
) -> Option<MoveResult>
fn travel_in_lava( &self, input: DVec3, base_gravity: f64, is_falling: bool, old_y: f64, ) -> Option<MoveResult>
Mirrors vanilla LivingEntity.travelInLava().
Sourcefn travel_in_fluid(&self, input: DVec3) -> Option<MoveResult>
fn travel_in_fluid(&self, input: DVec3) -> Option<MoveResult>
Mirrors vanilla LivingEntity.travelInFluid().
Sourcefn update_fall_flying(&self)
fn update_fall_flying(&self)
Mirrors the validation part of vanilla LivingEntity.updateFallFlying().
Sourcefn update_fall_flying_movement(&self, movement: DVec3) -> DVec3
fn update_fall_flying_movement(&self, movement: DVec3) -> DVec3
Mirrors vanilla LivingEntity.updateFallFlyingMovement().
Sourcefn stop_fall_flying(&self)
fn stop_fall_flying(&self)
Mirrors vanilla LivingEntity.stopFallFlying().
Sourcefn handle_fall_flying_collisions(
&self,
previous_horizontal_speed: f64,
new_horizontal_speed: f64,
)
fn handle_fall_flying_collisions( &self, previous_horizontal_speed: f64, new_horizontal_speed: f64, )
Mirrors vanilla LivingEntity.handleFallFlyingCollisions().
Sourcefn travel_fall_flying(&self, input: DVec3) -> Option<MoveResult>
fn travel_fall_flying(&self, input: DVec3) -> Option<MoveResult>
Mirrors vanilla LivingEntity.travelFallFlying().
Sourcefn default_travel(&self, input: DVec3) -> Option<MoveResult>
fn default_travel(&self, input: DVec3) -> Option<MoveResult>
Default vanilla LivingEntity.travel() implementation for overrides.
Sourcefn travel(&self, input: DVec3) -> Option<MoveResult>
fn travel(&self, input: DVec3) -> Option<MoveResult>
Mirrors vanilla LivingEntity.travel().
Sourcefn sleeping_pos(&self) -> Option<BlockPos>
fn sleeping_pos(&self) -> Option<BlockPos>
Returns the bed position that makes this living entity sleeping.
Sourcefn set_sleeping_pos(&self, bed_position: BlockPos)
fn set_sleeping_pos(&self, bed_position: BlockPos)
Sets the vanilla living-entity sleeping position.
Sourcefn clear_sleeping_pos(&self)
fn clear_sleeping_pos(&self)
Clears the vanilla living-entity sleeping position.
Sourcefn is_sleeping(&self) -> bool
fn is_sleeping(&self) -> bool
Checks if the entity is sleeping.
Sourcefn stop_sleeping(&self)
fn stop_sleeping(&self)
Stops the entity from sleeping.
Sourcefn is_sprinting(&self) -> bool
fn is_sprinting(&self) -> bool
Checks if the entity is sprinting.
Sourcefn set_sprinting(&self, sprinting: bool)
fn set_sprinting(&self, sprinting: bool)
Sets whether the entity is sprinting.
Sourcefn apply_post_impulse_grace_time(&self, ticks: i32)
fn apply_post_impulse_grace_time(&self, ticks: i32)
Applies vanilla post-impulse movement validation grace.
Sourcefn set_ignore_fall_damage_from_current_impulse(
&self,
ignore_fall_damage: bool,
new_impulse_impact_pos: DVec3,
)
fn set_ignore_fall_damage_from_current_impulse( &self, ignore_fall_damage: bool, new_impulse_impact_pos: DVec3, )
Mirrors vanilla LivingEntity.setIgnoreFallDamageFromCurrentImpulse.
Sourcefn is_ignoring_fall_damage_from_current_impulse(&self) -> bool
fn is_ignoring_fall_damage_from_current_impulse(&self) -> bool
Returns vanilla LivingEntity.isIgnoringFallDamageFromCurrentImpulse.
Sourcefn current_impulse_impact_pos(&self) -> Option<DVec3>
fn current_impulse_impact_pos(&self) -> Option<DVec3>
Returns vanilla LivingEntity.currentImpulseImpactPos.
Sourcefn try_reset_current_impulse_context(&self)
fn try_reset_current_impulse_context(&self)
Mirrors vanilla LivingEntity.tryResetCurrentImpulseContext.
Sourcefn reset_current_impulse_context(&self)
fn reset_current_impulse_context(&self)
Mirrors vanilla LivingEntity.resetCurrentImpulseContext.
Sourcefn is_in_post_impulse_grace_time(&self) -> bool
fn is_in_post_impulse_grace_time(&self) -> bool
Returns whether movement validation is inside post-impulse grace.
Sourcefn tick_post_impulse_grace_time(&self)
fn tick_post_impulse_grace_time(&self)
Decrements post-impulse grace once per living-entity tick.
Sourcefn refresh_dirty_attributes(&self)
fn refresh_dirty_attributes(&self)
Drains dirty attributes and applies server-side effects.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".