Skip to main content

BatEntity

Struct BatEntity 

Source
pub struct BatEntity {
    base: EntityBase,
    entity_type: EntityTypeRef,
    living_base: LivingEntityBase,
    mob_base: MobBase,
    entity_data: SyncMutex<BatEntityData>,
    target_position: SyncMutex<Option<BlockPos>>,
}
Expand description

Vanilla bat entity.

Fields§

§base: EntityBase§entity_type: EntityTypeRef§living_base: LivingEntityBase§mob_base: MobBase§entity_data: SyncMutex<BatEntityData>§target_position: SyncMutex<Option<BlockPos>>

Implementations§

Source§

impl BatEntity

Source

pub(crate) const SPAWN_RULE: fn(EntityTypeRef, &dyn LevelReader, EntitySpawnReason, BlockPos, &mut dyn Rng) -> bool = Self::check_bat_spawn_rules

Source

pub(crate) fn check_bat_spawn_rules( entity_type: EntityTypeRef, level: &dyn LevelReader, spawn_reason: EntitySpawnReason, pos: BlockPos, random: &mut dyn Rng, ) -> bool

Bats spawn below the world surface in dark places on bats_spawnable_on blocks.

Source

pub fn new( entity_type: EntityTypeRef, id: i32, position: DVec3, world: Weak<World>, ) -> Self

Creates a new bat at runtime.

Source

pub fn from_saved(entity_type: EntityTypeRef, load: EntityBaseLoad) -> Self

Reconstructs a bat from persisted base entity state.

Source

fn new_with_base(base: EntityBase, entity_type: EntityTypeRef) -> Self

Source

pub fn is_resting(&self) -> bool

Returns if the bat is resting.

Source

pub fn set_resting(&self, resting: bool)

Sets if the bat is resting.

Source

fn update_dirty_mob_effect_entity_data(&self)

Source

fn tick_resting_ai(&self, world: &World, pos: BlockPos, above: BlockPos)

Ticks the AI while the bat is resting.

Source

fn tick_flying_ai(&self, world: &World, above: BlockPos)

Ticks the AI while the bat is flying.

Source

fn random_target_position(&self) -> BlockPos

Picks a random target block around the bat.

Trait Implementations§

Source§

impl DefaultEntityPush for BatEntity

Source§

fn push_snapshot(&self, known_pushable: bool) -> Option<EntityPushSnapshot>

Push inputs for one contact, or None while riding. known_pushable skips the is_pushable check when the selector has already passed this entity.
Source§

impl DowncastType for BatEntity

Source§

const TYPE_KEY: DowncastTypeKey

The process-wide key for this concrete type.
Source§

impl Entity for BatEntity

Source§

fn is_hard_collision_relevant(&self) -> bool

Whether movement queries must consider this entity for hard collisions. Read more
Source§

fn as_default_entity_push(&self) -> Option<&dyn DefaultEntityPush>

Opts this entity into the DefaultEntityPush fast path. It is read under the entity manager lock, so it must give the same answer for the entity’s whole lifetime and have no side effects.
Source§

fn base(&self) -> &EntityBase

Returns a reference to the entity’s shared vanilla base fields.
Source§

fn entity_type(&self) -> EntityTypeRef

Gets the entity type containing tracking range, dimensions, etc.
Source§

fn base_tick(&self)

Runs vanilla Entity.baseTick pieces Steel currently implements. Read more
Source§

fn tick(self: Arc<Self>)

Called every game tick when the entity is in a ticked chunk. Read more
Source§

fn dimensions_for_pose(&self, _pose: EntityPose) -> EntityDimensions

Returns vanilla dimensions for a physical pose.
Source§

fn synced_data(&self) -> Option<&dyn EntitySyncedData>

Returns the synchronized entity-data container for entities with vanilla data accessors.
Source§

fn update_data_before_sync(&self)

Updates synchronized entity data just before tracker sync.
Source§

fn max_up_step(&self) -> f32

Maximum height this entity can step up during normal movement.
Source§

fn is_pushable(&self) -> bool

Returns whether this entity participates in vanilla push separation. Read more
Source§

fn is_ignoring_block_triggers(&self) -> bool

Returns whether this entity is excluded from pressure plates and tripwires. Read more
Source§

fn movement_emission(&self) -> EntityMovementEmission

Returns vanilla movement side effects emitted by this entity.
Source§

fn check_fall_damage( self: Arc<Self>, _vertical_movement: f64, _on_ground: bool, _on_state: BlockStateId, _pos: BlockPos, _world: &Arc<World>, )

Accumulates fall distance, applies landing damage from the block fallen on, and resets it.
Source§

fn is_flapping(&self) -> bool

Returns whether the entity is currently flapping.
Source§

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

Applies damage to this entity.
Source§

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

Saves type-specific entity data to NBT. Read more
Source§

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

Loads type-specific entity data from NBT. Read more
Source§

fn is_always_ticking(&self) -> bool

Returns whether this entity ignores chunk ticking visibility.
Source§

fn broadcast_to_player(&self, _player: &Player) -> bool

Returns whether this entity should be broadcast to the given player. Read more
Source§

fn id(&self) -> i32

Gets the entity’s unique network ID (session-local).
Source§

fn generation(&self) -> EntityGeneration

Gets the generation counter of this runtime construction of the entity.
Source§

fn uuid(&self) -> Uuid

Gets the UUID of the entity (persistent identifier).
Source§

fn scoreboard_name(&self) -> String

Returns this entity’s vanilla scoreboard holder name. Read more
Source§

fn name(&self) -> TextComponent

Returns this entity’s vanilla name component before team decoration.
Source§

fn display_name(&self) -> TextComponent

Returns this entity’s vanilla display name.
Source§

fn plain_text_name(&self) -> String

Returns this entity’s plain vanilla name. Read more
Source§

fn nbt_for_data_compare(&self) -> NbtCompound

Returns the vanilla-shaped entity NBT used by command predicates. Read more
Source§

fn nbt_for_passenger_save(&self) -> Option<NbtCompound>

Returns passenger-save NBT including the entity type id.
Source§

fn position(&self) -> DVec3

Gets the entity’s current position.
Source§

fn spawn_position(&self) -> DVec3

Gets the position to send in this entity’s add-entity packet. Read more
Source§

fn block_position(&self) -> BlockPos

Gets the entity’s current block position.
Source§

fn in_block_state(&self, world: &World) -> BlockStateId

Returns the block state this entity’s origin currently overlaps.
Source§

fn old_position(&self) -> DVec3

Gets the entity position used by vanilla movement traces.
Source§

fn bounding_box(&self) -> WorldAabb

Gets the entity’s bounding box for collision queries.
Source§

fn is_free(&self, delta: DVec3) -> bool

Returns whether the bounding box shifted by delta is free of block collisions and liquids.
Source§

fn blocks_building(&self) -> bool

Returns whether this entity obstructs block placement. Read more
Source§

fn is_pickable(&self) -> bool

Returns whether this entity can be targeted by picking and interaction raycasts. Read more
Source§

fn attackable(&self) -> bool

Returns whether this entity can be attacked. Read more
Source§

fn skip_attack_interaction(&self, _source: &SharedEntity) -> bool

Returns whether this entity handles and consumes an attack before normal damage.
Source§

fn is_pushed_by_fluid(&self) -> bool

Returns whether vanilla fluid currents can push this entity. Read more
Source§

fn on_above_bubble_column(&self, drag_down: bool, pos: BlockPos)

Applies bubble-column surface push velocity, dispatching to the projectile override when this entity is a projectile.
Source§

fn default_on_above_bubble_column(&self, drag_down: bool, pos: BlockPos)

Applies the base entity’s clamped bubble-column surface movement.
Source§

fn on_inside_bubble_column(&self, drag_down: bool)

Applies bubble-column push velocity while submerged in the column, dispatching to the projectile override when this entity is a projectile.
Source§

fn default_on_inside_bubble_column(&self, drag_down: bool)

Applies the base entity’s clamped movement inside a bubble-column.
Source§

fn is_spectator(&self) -> bool

Returns whether this entity is invisible to normal entity selectors. Read more
Source§

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

Returns the living entity credited as this explosion’s indirect source.
Source§

fn explosion_damage_origin(&self) -> DVec3

Returns the point used to calculate this entity’s explosion direction.
Source§

fn ignore_explosion(&self, _explosion: &dyn Explosion) -> bool

Returns whether this entity is wholly ignored by an explosion.
Source§

fn block_explosion_resistance( &self, explosion: &dyn Explosion, world: &World, pos: BlockPos, state: BlockStateId, fluid: FluidState, resistance: f32, ) -> f32

Lets an entity source modify effective block or fluid resistance.
Source§

fn should_block_explode( &self, explosion: &dyn Explosion, world: &World, pos: BlockPos, state: BlockStateId, power: f32, ) -> bool

Lets an entity source veto one affected block position.
Source§

fn on_explosion_hit(&self, _explosion_source: Option<&dyn Entity>)

Called after this entity is processed by an explosion.
Source§

fn piston_push_reaction(&self) -> PushReaction

Returns how vanilla lets this entity respond to piston movement.
Source§

fn is_supported_by(&self, pos: BlockPos) -> bool

Returns whether this entity’s main supporting block is pos.
Source§

fn can_interact_with_level(&self) -> bool

Returns whether vanilla lets this entity interact with its loaded level.
Source§

fn is_invisible(&self) -> bool

Returns whether this entity is invisible, per its synced entity data.
Source§

fn is_discrete(&self) -> bool

Returns whether this entity is sneaking (shift key down), per its synced entity data.
Source§

fn is_allied_to(&self, _other: &dyn Entity) -> bool

Returns whether this entity is allied to other.
Source§

fn is_marker_armor_stand(&self) -> bool

Returns whether this entity is a marker armor stand.
Source§

fn is_tame_owned_by(&self, _owner: &dyn LivingEntity) -> bool

Returns whether this entity is a tameable animal owned by owner.
Source§

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

Returns the vanilla Projectile owner UUID when this entity exposes one.
Source§

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

Returns the live vanilla Projectile owner when this entity exposes one.
Source§

fn is_flying_player(&self) -> bool

Returns true for vanilla players whose abilities have flying set.
Source§

fn can_be_collided_with(&self, _other: Option<&dyn Entity>) -> bool

Returns whether other can collide with this entity. Read more
Source§

fn can_be_hit_by_projectile(&self) -> bool

Returns whether projectile collision may interact with this entity.
Source§

fn deflection(&self, _projectile: &dyn Projectile) -> ProjectileDeflection

Returns this entity’s Vanilla projectile deflection behavior.
Source§

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

Gets the vehicle this entity is riding, if present.
Source§

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

Returns the vehicle this entity directly controls, if any.
Source§

fn is_passenger(&self) -> bool

Returns whether this entity is riding another entity.
Source§

fn can_ride(&self, _vehicle: &dyn Entity) -> bool

Returns whether vanilla allows this entity to start riding vehicle.
Source§

fn stop_riding(&self)

Stops riding the current vehicle, if any.
Source§

fn eject_passengers(&self)

Dismounts every passenger from this entity.
Source§

fn start_riding(&self, entity_to_ride: &SharedEntity) -> bool

Starts riding entity_to_ride if vanilla boarding rules allow it.
Source§

fn passengers(&self) -> Vec<SharedEntity> ⓘ

Gets this entity’s direct passengers.
Source§

fn count_player_passengers(&self) -> usize

Counts indirect player passengers.
Source§

fn has_exactly_one_player_passenger(&self) -> bool

Returns whether this entity has exactly one indirect player passenger.
Source§

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

Gets this entity’s first direct passenger.
Source§

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

Returns the living passenger currently controlling this entity, if any. Read more
Source§

fn can_control_vehicle(&self) -> bool

Returns whether this entity can control a vehicle it is riding.
Source§

fn has_controlling_passenger(&self) -> bool

Returns whether this entity currently has a controlling passenger.
Source§

fn is_vehicle(&self) -> bool

Returns whether this entity has any direct passengers.
Source§

fn dismounts_underwater(&self) -> bool

Returns whether this entity’s passengers are forced to dismount when it goes underwater, per the dismounts_underwater entity type tag.
Source§

fn has_passenger(&self, passenger: &dyn Entity) -> bool

Returns whether passenger is a direct passenger of this entity.
Source§

fn can_add_passenger(&self, _passenger: &dyn Entity) -> bool

Returns whether this entity can accept passenger as a direct passenger.
Source§

fn could_accept_passenger(&self) -> bool

Returns whether this entity can accept any passenger.
Source§

fn passenger_index(&self, passenger: &dyn Entity) -> Option<usize>

Returns the current direct passenger index for attachment lookup.
Source§

fn vehicle_attachment_point(&self, _vehicle: &dyn Entity) -> DVec3

Returns this passenger’s vehicle attachment point.
Source§

fn default_passenger_attachment_point(&self, passenger: &dyn Entity) -> DVec3

Returns this vehicle’s passenger attachment point for this entity’s dimensions and seat index, rotated by the vehicle’s yaw.
Source§

fn passenger_attachment_point(&self, passenger: &dyn Entity) -> DVec3

Returns the vehicle-relative position where this passenger attaches to.
Source§

fn passenger_riding_position(&self, passenger: &dyn Entity) -> DVec3

Returns the world position where passenger should ride this vehicle.
Source§

fn position_rider(&self, passenger: &dyn Entity)

Repositions a direct passenger from this vehicle’s attachment point.
Source§

fn root_vehicle_id(&self) -> i32

Returns this entity’s root vehicle ID, or this entity’s ID when it is not riding. Read more
Source§

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

Returns this entity’s root vehicle, if this entity is riding one.
Source§

fn is_passenger_of_same_vehicle(&self, other: &dyn Entity) -> bool

Returns whether this entity and other share the same root vehicle.
Source§

fn has_indirect_passenger(&self, entity: &dyn Entity) -> bool

Returns whether entity is an indirect passenger of this entity.
Source§

fn can_collide_with(&self, other: &dyn Entity) -> bool

Returns whether this entity can collide with other.
Source§

fn push_impulse(&self, impulse: DVec3)

Adds an impulse to this entity’s velocity and marks velocity for sync.
Source§

fn push_entity(&self, entity: &dyn Entity)

Applies vanilla entity-to-entity push separation.
Source§

fn make_bounding_box_at(&self, position: DVec3) -> WorldAabb

Builds this entity’s default bounding box at position.
Source§

fn get_relative_portal_position( &self, axis: Axis, portal_area: FoundRectangle, ) -> DVec3

Returns this entity’s position relative to the portal, in portal-local space; living entities have their forward-axis offset reset to zero.
Source§

fn default_tick(&self)

Concrete entity ticks that mirror vanilla super.tick() should call this rather than calling Self::base_tick directly.
Source§

fn ride_tick(self: Arc<Self>)

Called every game tick while this entity is riding another entity.
Source§

fn default_ride_tick(self: Arc<Self>)

The default implementation of Entity.rideTick when not overridden.
Source§

fn handle_portal(&self)

Runs vanilla Entity.handlePortal behavior currently implemented by Steel.
Source§

fn entity_base_tick(&self)

Runs only vanilla Entity.baseTick behavior. Read more
Source§

fn check_below_world(&self)

Applies vanilla below-world handling.
Source§

fn on_below_world(&self)

Runs entity-specific behavior after falling below the world.
Source§

fn check_despawn(&self)

Runs vanilla pre-tick despawn checks.
Source§

fn apply_inside_block_effect(&self, effect_type: InsideBlockEffectType)

Applies an inside-block effect queued by vanilla’s step-based collector.
Source§

fn level(&self) -> Option<Arc<World>>

Gets the world this entity is in. Read more
Source§

fn pack_dirty_entity_data(&self) -> Option<Vec<DataValue>>

Packs dirty entity data for network synchronization. Read more
Source§

fn pack_all_entity_data(&self) -> Vec<DataValue>

Packs all non-default entity data for initial spawn. Read more
Source§

fn is_removed(&self) -> bool

Returns true if the entity has been marked for removal.
Source§

fn is_alive(&self) -> bool

Returns whether this entity is alive for vanilla generic entity checks.
Source§

fn begin_pending_world_change(&self) -> Option<PendingWorldChangeToken>

Marks this entity as waiting for a prepared world change.
Source§

fn finish_pending_world_change(&self, token: PendingWorldChangeToken) -> bool

Clears a pending world change if it still matches the provided token.
Source§

fn is_world_change_pending(&self) -> bool

Returns true while this entity is waiting for a prepared world change.
Source§

fn is_world_change_token_pending(&self, token: PendingWorldChangeToken) -> bool

Returns true if the given world-change token is still pending.
Source§

fn can_use_portal(&self, ignore_passenger: bool) -> bool

Returns whether this entity may enter a portal. Read more
Source§

fn dimension_changing_delay(&self) -> i32

Returns vanilla’s dimension-changing portal cooldown delay in ticks. Read more
Source§

fn removal_reason(&self) -> Option<RemovalReason>

Returns why this entity was removed, if it has been removed.
Source§

fn set_removed(&self, reason: RemovalReason)

Marks the entity as removed with the given reason.
Source§

fn game_event_with_source_entity( &self, event: GameEventRef, source_entity: Option<&dyn Entity>, )

Emits a vanilla game event from this entity’s exact position with an explicit source entity.
Source§

fn game_event(&self, event: GameEventRef)

Emits a vanilla game event from this entity’s exact position.
Source§

fn kill(&self, world: &World)

Kills this entity using vanilla’s living/non-living class split. Read more
Source§

fn restore_owner_reference(&self, _owner: &SharedEntity)

Caches a live owner reference after restoring persisted owner-linked entities. Most entities do not store owner references.
Source§

fn on_teleported(&self)

Called after a teleport completes successfully.
Source§

fn set_level_callback(&self, callback: Arc<dyn EntityLevelCallback>)

Sets the level callback for lifecycle events (movement, removal).
Source§

fn notify_leash_holder(&self, _leashable: &dyn Entity)

Called by leashables while this entity is their live leash holder.
Source§

fn notify_leashee_removed(&self, _leashable: &dyn Entity)

Called when a leashable stops using this entity as its live leash holder.
Source§

fn player_touch(self: Arc<Self>, _player: &Arc<Player>)

Called when a player touches this entity during nearby pickup processing.
Source§

fn leashables_leashed_to(&self) -> Vec<SharedEntity> ⓘ

Finds leashable mobs in vanilla’s nearby leash scan whose holder is this entity.
Source§

fn leashables_leashed_to_holder_in_area( &self, holder: &dyn Entity, ) -> Vec<SharedEntity> ⓘ

Finds leashable mobs in this entity’s nearby leash scan whose holder is holder.
Source§

fn transfer_leashables_from_holder(&self, old_holder: &dyn Entity) -> bool

Transfers leashables currently held by old_holder to this entity.
Source§

fn drop_all_leash_connections(&self, player: Option<&Player>) -> bool

Drops this entity’s leash and all leashables attached to it.
Source§

fn shear_off_all_leash_connections(&self, player: Option<&Player>) -> bool

Shears off all leash connections reachable from this entity.
Source§

fn attempt_to_shear_equipment( &self, player: &Player, hand: InteractionHand, ) -> bool

Shears the first shearable equipped item on this mob, spawning it as a dropped item and playing its shearing sound; returns whether anything was sheared.
Source§

fn interact( &self, player: &Player, hand: InteractionHand, location: DVec3, ) -> InteractionResult

Handles vanilla entity right-click interaction.
Source§

fn interact_entity( &self, player: &Player, hand: InteractionHand, _location: DVec3, ) -> InteractionResult

Shared right-click interaction for mobs: leashing/unleashing, cutting leash connections, or shearing equipment with shears.
Source§

fn is_living_entity(&self) -> bool

Returns true for entities that implement vanilla living-entity behavior.
Source§

fn is_abstract_arrow(&self) -> bool

Returns whether this entity belongs to vanilla’s AbstractArrow hierarchy.
Source§

fn as_projectile(&self) -> Option<&dyn Projectile>

Returns this entity as a projectile when it has projectile behavior.
Source§

fn as_living_entity(&self) -> Option<&dyn LivingEntity>

Returns this entity as a living entity when it has living behavior.
Source§

fn as_item_frame(&self) -> Option<&dyn ItemFrame>

Returns this entity as an item frame when it has item-frame behavior.
Source§

fn as_player(&self) -> Option<&Player>

Returns this entity as a player when it is the concrete server player.
Source§

fn with_weapon_item(&self, visitor: &mut dyn FnMut(Option<&ItemStack>))

Visits vanilla Entity.getWeaponItem without copying inventory state.
Source§

fn is_pathfinder_mob(&self) -> bool

Returns true for mobs with pathfinding navigation.
Source§

fn as_pathfinder_mob(&self) -> Option<&dyn PathfinderMob>

Returns this entity as a pathfinder mob when it has pathfinding behavior.
Source§

fn is_mob(&self) -> bool

Returns true for entities that implement vanilla mob behavior.
Source§

fn as_mob(&self) -> Option<&dyn Mob>

Returns this entity as a mob when it has mob behavior.
Source§

fn as_leashable(&self) -> Option<&dyn Leashable>

Returns this entity as a Leashable if it has Leashable behavior.
Source§

fn as_abstract_minecart(&self) -> Option<&dyn AbstractMinecart>

Returns this entity as an AbstractMinecart if it has AbstractMinecart behavior.
Source§

fn is_animal(&self) -> bool

Returns true for entities that implement vanilla animal behavior.
Source§

fn as_animal(&self) -> Option<&dyn Animal>

Returns this entity as an animal when it has animal behavior.
Source§

fn is_monster(&self) -> bool

Returns true for entities that implement vanilla hostile-mob behavior.
Source§

fn as_monster(&self) -> Option<&dyn Monster>

Returns the Monster capability, equivalent to vanilla’s instanceof Monster.
Source§

fn is_enemy(&self) -> bool

Whether this entity implements the Enemy marker.
Source§

fn as_enemy(&self) -> Option<&dyn Enemy>

Returns the Enemy marker, equivalent to vanilla’s instanceof Enemy.
Source§

fn is_ageable_mob(&self) -> bool

Returns true for entities that implement vanilla ageable-mob behavior.
Source§

fn as_ageable_mob(&self) -> Option<&dyn AgeableMob>

Returns this entity as an ageable mob when it has ageable behavior.
Source§

fn is_item_steerable(&self) -> bool

Returns true for entities that implement vanilla item-steered boosts.
Source§

fn as_item_steerable(&self) -> Option<&dyn ItemSteerable>

Returns this entity as item steerable when it has item-steering behavior.
Source§

fn forces_fall_flying_velocity_sync(&self) -> bool

Returns whether this entity’s velocity should sync every tick because it’s currently fall-flying with an elytra.
Source§

fn uses_client_movement_packets(&self) -> bool

Returns true when movement is driven by serverbound movement packets.
Source§

fn is_server_driven_movement(&self) -> bool

Returns true when normal server ticks drive this entity’s movement.
Source§

fn can_simulate_movement(&self) -> bool

Returns true when vanilla allows this side to apply movement simulation side effects.
Source§

fn is_effective_ai(&self) -> bool

Returns true when vanilla allows this side to run entity AI/travel logic.
Source§

fn is_suppressing_bounce(&self) -> bool

Returns true when vanilla landing bounce should be suppressed.
Source§

fn is_stepping_carefully(&self) -> bool

Returns true when vanilla block step-on hooks should treat this entity as careful.
Source§

fn is_descending(&self) -> bool

Returns true when vanilla collision context should treat the entity as descending.
Source§

fn set_shared_shift_key_down(&self, shift_key_down: bool)

Sets the vanilla shift-key-down shared flag.
Source§

fn set_shared_swimming(&self, swimming: bool)

Sets the vanilla swimming shared flag.
Source§

fn update_swimming(&self)

Updates the vanilla swimming shared flag.
Source§

fn default_update_swimming(&self)

Shared body of vanilla Entity.updateSwimming for player overrides.
Source§

fn set_shared_sprinting(&self, sprinting: bool)

Sets the vanilla sprinting shared flag.
Source§

fn set_shared_fall_flying(&self, fall_flying: bool)

Sets the vanilla fall-flying shared flag.
Source§

fn is_flying_vehicle(&self) -> bool

Returns whether vanilla excludes this vehicle from floating kicks.
Source§

fn on_climbable(&self) -> bool

Returns true if vanilla rules consider this entity to be on a climbable block.
Source§

fn default_known_movement(&self) -> DVec3

Returns vanilla’s base known movement before entity-specific adjustments.
Source§

fn known_movement(&self) -> DVec3

Returns the movement vector vanilla exposes for block-contact logic.
Source§

fn known_speed(&self) -> DVec3

Returns the base-tick displacement vanilla exposes as getKnownSpeed.
Source§

fn tick_count(&self) -> i32

Returns the number of ticks this entity has existed for.
Source§

fn is_first_tick(&self) -> bool

Returns whether this entity has not completed its first tick.
Source§

fn set_first_tick(&self, first_tick: bool)

Sets whether this entity has not completed its first tick.
Source§

fn advance_tick_count(&self)

Advances this entity’s tick counter by one.
Source§

fn fall_sounds(&self) -> (SoundEventRef, SoundEventRef)

Returns vanilla small and big fall sounds for this entity.
Source§

fn rotation(&self) -> (f32, f32)

Gets the entity’s rotation as (yaw, pitch) in degrees. Read more
Source§

fn set_rotation(&self, rotation: (f32, f32))

Sets the entity’s rotation as (yaw, pitch) in degrees.
Source§

fn direction_yaw(&self) -> Direction

Gets the nearest horizontal direction to the entity’s yaw (horizontal rotation).
Source§

fn motion_direction(&self) -> Direction

Returns the horizontal direction used for movement-dependent behavior.
Source§

fn look_at(&self, from_anchor: EntityAnchor, target: DVec3)

Rotates this entity to face a fixed position.
Source§

fn look_at_entity( &self, from_anchor: EntityAnchor, target: &dyn Entity, target_anchor: EntityAnchor, )

Rotates this entity to follow an anchored point on another entity.
Source§

fn head_yaw(&self) -> f32

Returns this entity’s head yaw; 0.0 for non-living entities.
Source§

fn spawn_data(&self) -> i32

Extra spawn-packet data used by vanilla for entity-specific construction.
Source§

fn get_eye_height(&self) -> f64

Gets the eye height for this entity. Read more
Source§

fn get_fluid_jump_threshold(&self) -> f64

Returns the fluid-surface height threshold used for fluid-jump physics: 0.0 for entities with eye height under 0.4, otherwise 0.4.
Source§

fn get_eye_y(&self) -> f64

Gets the Y coordinate of the entity’s eyes.
Source§

fn is_in_wall(&self) -> bool

Returns whether the entity is currently suffocating inside a solid block.
Source§

fn calculate_view_vector(&self, pitch_degrees: f32, yaw_degrees: f32) -> DVec3

Computes a unit look-direction vector from the given pitch and yaw in degrees.
Source§

fn look_angle(&self) -> DVec3

Returns this entity’s current unit look-direction vector.
Source§

fn hand_holding_item_angle(&self, item: ItemRef) -> DVec3

Returns the vanilla offset for the hand holding item. Read more
Source§

fn velocity(&self) -> DVec3

Gets the entity’s velocity in blocks per tick.
Source§

fn set_velocity(&self, velocity: DVec3)

Sets the entity’s velocity.
Source§

fn needs_velocity_sync(&self) -> bool

Returns whether this entity’s velocity has changed enough to need syncing to clients.
Source§

fn mark_velocity_sync(&self)

Marks this entity’s velocity as needing to be synced to clients.
Source§

fn clear_velocity_sync(&self)

Clears the vanilla velocity sync marker after send processing.
Source§

fn hurt_marked(&self) -> bool

Returns true when vanilla hurt-marked velocity sync is pending.
Source§

fn mark_hurt(&self)

Marks this entity as hurt for vanilla self-inclusive motion sync.
Source§

fn clear_hurt_mark(&self)

Clears the vanilla hurt-marked motion sync flag.
Source§

fn fall_distance(&self) -> f64

Returns accumulated vanilla fall distance.
Source§

fn is_in_powder_snow(&self) -> bool

Returns whether this entity is currently inside powder snow.
Source§

fn was_in_powder_snow(&self) -> bool

Returns whether this entity was inside powder snow during the previous base tick.
Source§

fn set_fall_distance(&self, fall_distance: f64)

Sets accumulated vanilla fall distance.
Source§

fn reset_fall_distance(&self)

Resets accumulated vanilla fall distance.
Source§

fn check_fall_distance_accumulation(&self)

Caps the accumulated fall distance at 1 once the entity is no longer falling faster than 0.5 blocks per tick.
Source§

fn fire_freeze_state(&self) -> EntityFireFreezeState

Returns the current vanilla fire/freeze state.
Source§

fn remaining_fire_ticks(&self) -> i32

Returns the ticks remaining before this entity stops burning.
Source§

fn set_remaining_fire_ticks(&self, remaining_fire_ticks: i32)

Sets the ticks remaining before this entity stops burning, clamped to this entity’s fire-ticks cap if any.
Source§

fn ticks_frozen(&self) -> i32

Returns ticks this entity has spent freezing in powder snow.
Source§

fn set_ticks_frozen(&self, ticks_frozen: i32)

Sets ticks this entity has spent freezing in powder snow, syncing the change to clients.
Source§

fn fire_immune(&self) -> bool

Returns whether this entity is immune to fire effects and fire damage.
Source§

fn fire_immune_ticks(&self) -> i32

Returns vanilla fire immunity cooldown ticks after not being ignited.
Source§

fn should_play_lava_hurt_sound(&self) -> bool

Returns whether vanilla should play this entity’s lava hurt sound.
Source§

fn lava_ignite(&self)

Ignites this entity in lava.
Source§

fn lava_hurt(&self)

Applies vanilla lava-contact damage after lava ignition effects.
Source§

fn remaining_fire_ticks_cap(&self) -> Option<i32>

Maximum ticks this entity’s remaining-fire timer can hold; None means unlimited.
Source§

fn fire_ignite_extra_ticks(&self) -> i32

Returns extra ticks added by fire-block ignition before 8-second ignition.
Source§

fn is_on_fire(&self) -> bool

Returns whether the entity is on fire on the server.
Source§

fn has_visual_fire(&self) -> bool

Returns whether this entity currently renders as visually on fire.
Source§

fn is_freezing(&self) -> bool

Returns whether the entity has any frozen ticks.
Source§

fn default_can_freeze(&self) -> bool

Returns vanilla Entity.canFreeze() without living-equipment overrides.
Source§

fn can_freeze(&self) -> bool

Returns whether this entity may accumulate frozen ticks.
Source§

fn ticks_required_to_freeze(&self) -> i32

Returns the ticks of powder-snow exposure required before this entity starts taking freeze damage.
Source§

fn is_fully_frozen(&self) -> bool

Returns whether this entity has reached full-freeze duration.
Source§

fn percent_frozen(&self) -> f32

Returns how frozen this entity is, from 0.0 to 1.0, based on ticks frozen versus ticks required.
Source§

fn clear_freeze(&self)

Clears accumulated freezing.
Source§

fn clear_fire(&self)

Clears fire without resetting the vanilla fire immunity cooldown.
Source§

fn extinguish_fire(&self)

Plays the extinguish sound when currently on fire, then clears fire.
Source§

fn ignite_for_ticks(&self, number_of_ticks: i32)

Ignites this entity for a vanilla tick duration.
Source§

fn sync_base_fire_freeze_entity_data(&self)

Projects base fire/freeze state into generated synced entity data.
Source§

fn sync_base_entity_data(&self)

Projects all base-owned synchronized fields into generated entity data.
Source§

fn is_in_water(&self) -> bool

Returns true if this entity is currently touching water.
Source§

fn is_in_rain(&self) -> bool

Returns true if rain falls at this entity’s feet or at the top of its bounding box.
Source§

fn is_in_water_or_rain(&self) -> bool

Returns true if this entity is touching water or standing in rain.
Source§

fn is_in_lava(&self) -> bool

Returns true if this entity is currently touching lava.
Source§

fn is_eye_in_water(&self) -> bool

Returns true if this entity’s eyes are currently inside water.
Source§

fn is_eye_in_lava(&self) -> bool

Returns true if this entity’s eyes are currently inside lava.
Source§

fn is_under_water(&self) -> bool

Returns vanilla underwater state.
Source§

fn fluid_contact(&self) -> EntityFluidContact

Returns cached fluid contact from the last entity fluid refresh.
Source§

fn refresh_fluid_contact(&self) -> EntityFluidContact

Refreshes cached fluid contact from this entity’s current bounding box.
Source§

fn update_fluid_interaction(&self) -> bool

Runs vanilla Entity.updateFluidInteraction: refreshes cached contact, emits the water-entry splash on transition, resets fall distance in water, and applies fluid currents. Read more
Source§

fn scan_and_store_fluid_contact( &self, advance_eye_water_history: bool, ) -> EntityFluidContact

Scans current fluid contact and stores it on the entity base. Read more
Source§

fn apply_fluid_current_impulses( &self, world: &Arc<World>, contact: EntityFluidContact, )

Applies vanilla water/lava current impulses from a fluid interaction update.
Source§

fn apply_fluid_current_impulse(&self, impulse: DVec3)

Applies a non-zero fluid current impulse and marks velocity sync.
Source§

fn is_fall_damage_immune(&self) -> bool

Returns true if this entity type ignores vanilla fall damage.
Source§

fn propagate_fall_to_passengers( &self, fall_distance: f64, damage_modifier: f32, source: &DamageSource, )

Propagates vanilla fall-damage handling to passengers.
Source§

fn cause_fall_damage( self: Arc<Self>, fall_distance: f64, damage_modifier: f32, source: &DamageSource, ) -> bool

Applies vanilla fall damage. Read more
Source§

fn on_ground(&self) -> bool

Returns true if the entity is on the ground.
Source§

fn horizontal_collision(&self) -> bool

Returns true if the last movement was clipped horizontally.
Source§

fn vertical_collision(&self) -> bool

Returns true if the last movement was clipped vertically.
Source§

fn vertical_collision_below(&self) -> bool

Returns true if the last vertical collision was below the entity.
Source§

fn no_physics(&self) -> bool

Returns true when movement bypasses collision physics.
Source§

fn is_affected_by_blocks(&self) -> bool

Returns true when vanilla block-contact effects may run for this entity.
Source§

fn set_no_physics(&self, no_physics: bool)

Sets whether this entity bypasses collision physics.
Source§

fn update_no_physics_from_current_collision(&self)

Updates item-style noPhysics from the entity’s current collision state.
Source§

fn move_towards_closest_space(&self, x: f64, y: f64, z: f64)

Nudges velocity toward the closest non-full collision block.
Source§

fn default_make_stuck_in_block( &self, _state: BlockStateId, speed_multiplier: DVec3, )

Default vanilla stuck-in-block movement for the next movement pass.
Source§

fn make_stuck_in_block(&self, state: BlockStateId, speed_multiplier: DVec3)

Applies vanilla stuck-in-block movement for the next movement pass.
Source§

fn apply_effects_from_blocks(&self)

Applies current block-contact effects to this entity. Read more
Source§

fn apply_effects_from_blocks_between(&self, from: DVec3, to: DVec3)

Applies block-contact effects for one explicit movement segment. Read more
Source§

fn apply_effects_from_blocks_for_last_movements(&self)

Replays the last finalized block-contact movement list.
Source§

fn land_after_teleport(&self)

What vanilla’s /teleport does once an entity has moved: unless it is gliding, it ends up on the ground without vertical motion.
Source§

fn set_on_ground(&self, on_ground: bool)

Sets whether the entity is on the ground.
Source§

fn set_on_ground_with_movement( &self, on_ground: bool, horizontal_collision: bool, movement: DVec3, )

Sets ground and horizontal collision flags from accepted movement.
Source§

fn default_apply_accepted_client_movement( self: Arc<Self>, world: &Arc<World>, accepted: AcceptedClientMovement, ) -> Result<AcceptedClientMovementOutcome, EntityMoveError>

Default final state application for accepted client-authored movement. Read more
Source§

fn apply_accepted_client_movement( self: Arc<Self>, world: &Arc<World>, accepted: AcceptedClientMovement, ) -> Result<AcceptedClientMovementOutcome, EntityMoveError>

Applies final state accepted from a client-authored movement packet.
Source§

fn apply_accepted_client_vehicle_movement( self: Arc<Self>, world: &Arc<World>, accepted: AcceptedClientMovement, ) -> Result<AcceptedClientMovementOutcome, EntityMoveError>

Applies final state accepted from a controlled-vehicle movement packet.
Source§

fn try_set_position(&self, pos: DVec3) -> Result<(), EntityMoveError>

Attempts to set the entity’s position through world lifecycle validation. Read more
Source§

fn try_set_position_base(&self, pos: DVec3) -> Result<(), EntityMoveError>

The base method to set the entity’s position through world lifecycle validation.
Source§

fn teleport_to(&self, pos: DVec3) -> Result<(), EntityMoveError>

Moves this entity to pos, keeping its current rotation.
Source§

fn set_old_position_to_current(&self)

Sets the vanilla movement-trace old position to the current position.
Source§

fn set_old_position(&self, old_position: DVec3)

Sets the vanilla movement-trace old position explicitly.
Source§

fn remove_latest_movement_recording(&self)

Removes the latest movement segment recorded this tick.
Source§

fn on_pos(&self, offset: f32) -> Option<BlockPos>

Returns the block position this entity is standing on.
Source§

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

Returns the block position used for movement-affecting block properties.
Source§

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

Returns vanilla getOnPosLegacy(), used by fall/step block hooks.
Source§

fn default_block_speed_factor(&self) -> f32

Returns the vanilla block speed factor applied after movement.
Source§

fn block_speed_factor(&self) -> f32

Returns the block speed factor applied after movement.
Source§

fn block_jump_factor(&self) -> f32

Returns the jump-height multiplier from the block at this entity’s position, falling back to the block below when the current one doesn’t modify jumps.
Source§

fn pose(&self) -> EntityPose

Returns this entity’s physical pose.
Source§

fn refresh_dimensions(&self)

Refreshes dimensions for the current physical pose.
Source§

fn fudge_position_after_size_change( &self, previous_dimensions: EntityDimensions, ) -> bool

Moves the entity to the closest free position for its new dimensions within the previous dimensions’ footprint, returning whether a valid position was found. Vanilla runs this after growing in a confined space; Steel’s ThrownEgg hatchlings also use it to fit a newborn chick at the egg’s impact point.
Source§

fn set_pose(&self, pose: EntityPose)

Sets the physical pose and synchronized pose metadata.
Source§

fn is_crouching(&self) -> bool

Returns whether vanilla currently considers this entity crouching.
Source§

fn is_swimming(&self) -> bool

Returns whether vanilla currently considers this entity swimming.
Source§

fn is_on_rails(&self) -> bool

Returns whether this entity is on rails.
Source§

fn is_state_climbable(&self, state: BlockStateId) -> bool

Returns whether a block state is climbable for base movement effects.
Source§

fn may_interact(&self, _world: &World, _pos: BlockPos) -> bool

Returns whether this entity may modify the world at a position. Read more
Source§

fn air_supply(&self) -> i32

Returns this entity’s current air supply in ticks, synced to clients.
Source§

fn set_air_supply(&self, air_supply: i32)

Sets this entity’s air supply in ticks, syncing the change to clients.
Source§

fn max_air_supply(&self) -> i32

Returns this entity’s maximum vanilla air supply.
Source§

fn portal_cooldown(&self) -> i32

Returns the vanilla portal cooldown in ticks.
Source§

fn set_portal_cooldown(&self, portal_cooldown: i32)

Sets the vanilla portal cooldown in ticks.
Source§

fn is_on_portal_cooldown(&self) -> bool

Returns whether the entity is on vanilla portal cooldown.
Source§

fn reset_portal_cooldown(&self)

Resets vanilla portal cooldown to this entity’s dimension-changing delay.
Source§

fn set_as_inside_portal(&self, portal: PortalKind, entry_position: BlockPos)

Marks this entity as inside a vanilla portal during the current tick.
Source§

fn custom_name(&self) -> Option<TextComponent>

Returns this entity’s optional vanilla custom name.
Source§

fn set_custom_name(&self, custom_name: Option<TextComponent>)

Sets this entity’s optional vanilla custom name.
Source§

fn is_custom_name_visible(&self) -> bool

Returns whether vanilla renders this entity’s custom name.
Source§

fn set_custom_name_visible(&self, visible: bool)

Sets whether vanilla renders this entity’s custom name.
Source§

fn has_glowing_tag(&self) -> bool

Returns whether this entity has the server-owned vanilla glowing tag.
Source§

fn set_glowing_tag(&self, glowing: bool)

Sets this entity’s server-owned vanilla glowing tag.
Source§

fn tags(&self) -> Vec<String>

Returns a snapshot of this entity’s vanilla scoreboard tags.
Source§

fn add_tag(&self, tag: String) -> bool

Adds a vanilla scoreboard tag.
Source§

fn remove_tag(&self, tag: &str) -> bool

Removes a vanilla scoreboard tag.
Source§

fn custom_data(&self) -> NbtCompound

Returns a snapshot of this entity’s vanilla custom data.
Source§

fn set_custom_data(&self, custom_data: NbtCompound)

Replaces this entity’s vanilla custom data.
Source§

fn sound_source(&self) -> SoundSource

Returns this entity’s vanilla sound source category.
Source§

fn swim_sound(&self) -> SoundEventRef

Returns this entity’s vanilla swim sound.
Source§

fn is_silent(&self) -> bool

Returns whether sounds from this entity are suppressed.
Source§

fn set_silent(&self, silent: bool)

Sets whether sounds from this entity are suppressed.
Source§

fn broadcast_entity_event(&self, event: EntityStatus)

Broadcasts a vanilla entity event/status packet near this entity.
Source§

fn play_sound(&self, sound: SoundEventRef, volume: f32, pitch: f32)

Plays an entity sound at the entity’s exact position.
Source§

fn swim_splash_sound(&self) -> SoundEventRef

Returns the sound played when this entity enters water at low speed.
Source§

fn swim_high_speed_splash_sound(&self) -> SoundEventRef

Returns the sound played when this entity enters water at high speed.
Source§

fn do_water_splash_effect(&self)

Plays the vanilla water-entry splash sound and emits SPLASH.
Source§

fn default_do_water_splash_effect(&self)

The default implementation of Entity.doWaterSplashEffect when not overridden.
Source§

fn play_entity_on_fire_extinguished_sound(&self)

Plays vanilla’s extinguished-on-fire entity sound.
Source§

fn play_step_sound(&self, _pos: BlockPos, block_state: BlockStateId)

Plays the base vanilla step sound for a block.
Source§

fn play_block_step_sound(&self, block_state: BlockStateId)

Plays a vanilla block step sound at this entity’s current position.
Source§

fn play_muffled_step_sound(&self, block_state: BlockStateId)

Plays vanilla’s muffled secondary step sound.
Source§

fn play_combination_step_sounds( &self, primary_step_sound: BlockStateId, secondary_step_sound: BlockStateId, )

Plays vanilla’s combination primary and secondary step sounds.
Source§

fn walking_step_sound(&self, pos: BlockPos, block_state: BlockStateId)

Plays vanilla walking step sounds, including amethyst chimes.
Source§

fn play_amethyst_step_sound(&self)

Plays vanilla amethyst step chime when its cooldown permits it.
Source§

fn water_swim_sound(&self)

Plays vanilla swim sound from movement emission.
Source§

fn play_swim_sound(&self, volume: f32)

Plays this entity’s swim sound at the given volume.
Source§

fn on_flap(&self)

Runs entity-specific flap side effects.
Source§

fn process_flapping_movement(&self)

Processes vanilla flap movement side effects.
Source§

fn next_step(&self) -> f32

Returns the next step threshold after movement side effects are produced.
Source§

fn apply_movement_emission_and_play_sound( &self, emission: EntityMovementEmission, clipped_movement: DVec3, effect_pos: BlockPos, effect_state: BlockStateId, )

Applies vanilla movement sounds and game events after a completed move.
Source§

fn apply_movement_side_effects_after_move( &self, world: &World, actual_movement: DVec3, )

Applies movement side effects after vanilla collision and landing updates.
Source§

fn vibration_and_sound_effects_from_block( &self, pos: BlockPos, block_state: BlockStateId, should_sound: bool, should_vibrate: bool, clipped_movement: DVec3, ) -> bool

Emits step side effects from a candidate movement-effect block.
Source§

fn backs_off_from_edge(&self) -> bool

Whether movement should apply player-style sneak edge prevention.
Source§

fn get_default_gravity(&self) -> f64

Gets the default gravity for this entity type. Read more
Source§

fn is_no_gravity(&self) -> bool

Returns true if gravity is disabled for this entity.
Source§

fn set_no_gravity(&self, no_gravity: bool)

Sets whether this entity ignores gravity, syncing the change to clients.
Source§

fn is_invulnerable(&self) -> bool

Returns whether this entity is invulnerable to non-bypassing damage.
Source§

fn set_invulnerable(&self, invulnerable: bool)

Sets whether this entity is invulnerable to non-bypassing damage.
Source§

fn get_gravity(&self) -> f64

Gets the current gravity value. Read more
Source§

fn get_air_drag(&self) -> f64

get the air drag value of the entity
Source§

fn apply_gravity(&self)

Applies gravity to the entity’s velocity.
Source§

fn move_relative(&self, speed: f32, input: DVec3)

Adds input scaled by speed, rotated to face this entity’s current yaw, to its velocity.
Source§

fn move_without_physics(&self, delta: DVec3) -> Option<MoveResult>

Moves the entity without collision physics.
Source§

fn default_move_entity( self: Arc<Self>, mover_type: MoverType, delta: DVec3, ) -> Option<MoveResult>

Moves the entity with collision detection. Read more
Source§

fn move_entity( self: Arc<Self>, mover_type: MoverType, delta: DVec3, ) -> Option<MoveResult>

Moves the entity with collision detection.
Source§

fn apply_fall_damage_after_move( self: Arc<Self>, result: &MoveResult, world: &Arc<World>, ) -> bool

Applies vanilla fall-distance bookkeeping after accepted movement.
Source§

fn reset_fall_distance_on_resetting_clip( &self, world: &Arc<World>, movement: DVec3, )

Resets fall distance when vanilla’s fall-damage-resetting clip hits.
Source§

fn do_check_fall_damage( self: Arc<Self>, movement: DVec3, on_ground: bool, world: &Arc<World>, ) -> bool

Applies fall damage from the block fallen on, then returns whether the entity was removed (e.g. killed) as a result. Read more
Source§

fn refresh_supporting_block_for_fall_damage( &self, movement: DVec3, on_ground: bool, )

Refreshes vanilla supporting-block state before fall-damage side effects.
Source§

fn send_landing_particles( &self, world: &World, on_state: BlockStateId, pos: BlockPos, )

Sends the vanilla landing burst for living entities with enough fall power.
Source§

fn ground_contact_after_movement( &self, on_ground: bool, movement: Option<DVec3>, ) -> EntityGroundContact

Computes vanilla support state for an on-ground update.
Source§

fn check_supporting_block( &self, on_ground: bool, movement: Option<DVec3>, world: &Arc<World>, ) -> EntityGroundContact

Determines the supporting block state and position underneath the entity while grounded.
Source§

fn spawn_at_location( &self, item: ItemStack, y_offset: f64, ) -> Option<Arc<ItemEntity>>

Spawns an item at this entity’s location. Read more
Source§

fn spawn_at_location_with_offset( &self, item: ItemStack, offset: DVec3, ) -> Option<Arc<ItemEntity>>

Spawns an item at this entity’s location plus a vanilla attachment offset.
Source§

fn apply_implicit_item_components(&self, _item_stack: &ItemStack)

Applies entity-specific implicit components carried by an item stack. Read more
Source§

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

Spawn-item data is merged into the entity’s current save state before it is loaded. Keeping that merge at the entity boundary preserves defaults and entity-specific state when the component only overrides one field.
Source§

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

Returns whether this entity is immune to damage from source: already removed, or invulnerable and the source doesn’t bypass invulnerability.
Source§

fn distance_to_sqr(&self, pos: DVec3) -> f64

Calculates the squared Euclidean distance from this entity’s position to the given position.
Source§

fn snap_to(&self, position: DVec3, yaw: f32, pitch: f32)

Sets position and rotation. Read more
Source§

fn killed_entity( &self, _world: &World, _entity: &dyn LivingEntity, _source: &DamageSource, ) -> bool

Runs when this entity causes another entity to die. The entity provided is the entity who was killed.
Source§

fn award_kill_score(&self, _victim: &dyn Entity, _killing_blow: &DamageSource)

Runs when this entity kills another entity.
Source§

impl LivingEntity for BatEntity

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.
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 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 push_entities(&self)

Pushes nearby colliding entities away from this one.
Source§

fn server_ai_step(&self, entity: &SharedEntity)

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

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

Runs one AI-driven movement and effect tick for the entity.
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. Read more
Source§

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

Drains syncable dirty attributes for per-tick tracking updates. Read more
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. Read more
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. Read more
Source§

fn default_voice_pitch(&self) -> f32

Returns the base voice pitch before entity-specific adjustments.
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. Read more
Source§

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

Runs the base LivingEntity.hurtServer body. Read more
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. Read more
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. Read more
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. Read more
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. Read more
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 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. Read more
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.
Source§

impl Mob for BatEntity

Source§

fn mob_base(&self) -> &MobBase

Source§

fn mob_can_be_leashed(&self) -> bool

Returns whether this mob can be leashed, before its leash state is considered.
Source§

fn custom_server_ai_step(&self)

Source§

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

Source§

fn mob_flags(&self) -> i8

Source§

fn set_mob_flags(&self, flags: i8)

Source§

fn check_spawn_rules( &self, _world: &Arc<World>, _reason: EntitySpawnReason, ) -> bool

Returns whether the entity-specific spawn predicate accepts this spawn.
Source§

fn set_baby(&self, baby: bool)

Sets the vanilla baby state. Vanilla Mob.setBaby is a no-op; ageable mobs derive it from their start age, and other mobs override as needed.
Source§

fn is_saddled(&self) -> bool

Returns whether this mob has a saddle equipped.
Source§

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

Checks line of sight using this mob sensing cache
Source§

fn ate(&self)

Runs vanilla Mob.ate, invoked after an eating goal resolves a block.
Source§

fn tick_goal_selectors(&self, _entity: &SharedEntity)

Source§

fn xp_reward(&self) -> i32

Source§

fn set_xp_reward(&self, xp_reward: i32)

Source§

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

Returns this mob’s current attack target, if it’s still a valid one.
Source§

fn set_target(&self, target: Option<&SharedEntity>) -> bool

Sets vanilla Mob.target. Read more
Source§

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

Source§

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

Returns whether this mob may attack the target; excludes ghasts, which mobs never target directly.
Source§

fn base_experience_reward_mob(&self) -> i32

Source§

fn ambient_sound_interval(&self) -> i32

Source§

fn play_ambient_sound(&self)

Source§

fn reset_ambient_sound_time(&self)

Source§

fn base_tick_mob(&self)

Runs the shared living-entity base tick, then mob-specific per-tick behavior.
Source§

fn mob_base_tick(&self)

Runs the mob-owned portion of vanilla Mob.baseTick.
Source§

fn finalize_spawn( &self, world: &Arc<World>, spawn_reason: EntitySpawnReason, group_data: Option<SpawnGroupData>, ) -> Option<SpawnGroupData>

Source§

fn finalize_spawn_mob_base( &self, _world: &Arc<World>, _spawn_reason: EntitySpawnReason, group_data: Option<SpawnGroupData>, ) -> Option<SpawnGroupData>

Source§

fn convert_to( &self, entity_type: EntityTypeRef, params: ConversionParams, after_conversion: Option<&AfterConversion<'_>>, ) -> Option<SharedEntity>
where Self: Sized,

Creates a replacement or split mob and transfers state according to params. The callback finalizes mob-specific state. Returns None without changing the source if it is removed or world, difficulty, factory, mob-type, or insertion checks fail.
Source§

fn check_mob_spawn_rules( entity_type: EntityTypeRef, level: &dyn LevelReader, spawn_reason: EntitySpawnReason, pos: BlockPos, ) -> bool
where Self: Sized,

Requires the block below to accept the spawn via BlockBehavior::is_valid_spawn, unless a spawner bypasses the surface check.
Source§

fn check_spawn_obstruction(&self, world: &Arc<World>) -> bool

Source§

fn interact_mob( &self, player: &Player, hand: InteractionHand, location: DVec3, ) -> InteractionResult

Dispatches held-item, entity, and mob-specific interactions in order.
Source§

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

Handles interactions that take priority over normal behavior: renaming with a name tag and spawning with a spawn egg.
Source§

fn mob_interact( &self, _player: &Player, _hand: InteractionHand, ) -> InteractionResult

Mob-specific interaction hook for concrete mobs to override; does nothing by default.
Source§

fn can_shear_equipment(&self, _player: &Player) -> bool

Returns whether this mob’s equipment can be sheared; false while something is riding it.
Source§

fn use_player_item(&self, player: &Player, hand: InteractionHand)

Consumes one of the player’s held item after this mob uses it in an interaction.
Source§

fn remove_when_far_away(&self, dist_sqr: f64) -> bool

Source§

fn requires_custom_persistence(&self) -> bool

Source§

fn is_persistence_required(&self) -> bool

Source§

fn set_persistence_required(&self)

Source§

fn can_pick_up_loot(&self) -> bool

Returns whether this mob is allowed to pick up dropped items.
Source§

fn set_can_pick_up_loot(&self, can_pick_up_loot: bool)

Source§

fn equipment_drop_chance(&self, slot: EquipmentSlot) -> f32

Source§

fn set_equipment_drop_chance(&self, slot: EquipmentSlot, chance: f32)

Source§

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

Source§

fn set_guaranteed_drop(&self, slot: EquipmentSlot)

Source§

fn get_pickup_reach(&self) -> DVec3

Vanilla Mob.getPickupReach: the per-axis distance the item-pickup search box is inflated by. Overridable so mobs with a longer reach can widen it.
Source§

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

Vanilla Mob.wantsToPickUp: whether this mob wants to collect the item it just walked over. Defaults to whatever the mob is willing to hold.
Source§

fn can_hold_item(&self, _item_stack: &ItemStack) -> bool

Vanilla Mob.canHoldItem: whether this mob is willing to hold the item. The base mob holds anything; specific mobs narrow this down.
Source§

fn pick_up_item(&self, world: &Arc<World>, item_entity: &ItemEntity)

Vanilla Mob.pickUpItem: take a dropped item into this mob’s equipment. Read more
Source§

fn equip_item_if_possible(&self, item_stack: ItemStack) -> ItemStack

Vanilla Mob.equipItemIfPossible: route item_stack to the slot its equippable component asks for (main hand otherwise), swap up when the target slot already holds worse gear, and drop the replaced piece by its drop chance. Returns the stack that was equipped, or empty when nothing was taken.
Source§

fn get_equipment_slot_for_item(&self, item_stack: &ItemStack) -> EquipmentSlot

Vanilla LivingEntity.getEquipmentSlotForItem: the slot an item wants to occupy, falling back to the main hand when it is not equippable or the mob cannot use that slot.
Source§

fn equipment_in_slot(&self, slot: EquipmentSlot) -> ItemStack

Returns a copy of whatever this mob currently holds in slot.
Source§

fn can_replace_current_item( &self, new_item_stack: &ItemStack, current_item_stack: &ItemStack, slot: EquipmentSlot, ) -> bool

Vanilla Mob.canReplaceCurrentItem: whether the freshly picked-up item should displace what is already in slot.
Source§

fn compare_armor( &self, new_item_stack: &ItemStack, current_item_stack: &ItemStack, slot: EquipmentSlot, ) -> bool

Vanilla Mob.compareArmor: prefer the piece granting more armor, then more toughness, then the equal-item tiebreak, unless the worn piece is protected against removal.
Source§

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

Vanilla Mob.getPreferredWeaponType: the item tag a mob favors for its main hand regardless of raw damage (a skeleton keeps its bow over a stronger sword). The base mob has no preference; specific mobs override it.
Source§

fn compare_weapons( &self, new_item_stack: &ItemStack, current_item_stack: &ItemStack, slot: EquipmentSlot, ) -> bool

Vanilla Mob.compareWeapons: keep a piece of the mob’s preferred weapon type over one that is not, otherwise prefer more attack damage, then the equal-item tiebreak.
Source§

fn approximate_attribute_with( &self, item_stack: &ItemStack, attribute: AttributeRef, slot: EquipmentSlot, ) -> f64

Vanilla Mob.getApproximateAttributeWith: the value of attribute this mob would have in slot while wearing item_stack, taking the mob’s base value (zero when it lacks the attribute) and folding in the item’s attribute modifiers.
Source§

fn can_replace_equal_item( &self, new_item_stack: &ItemStack, current_item_stack: &ItemStack, ) -> bool

Vanilla Mob.canReplaceEqualItem: the tiebreak when two pieces grade out equally, favoring more enchantments, then less damage, then a custom name.
Source§

fn tick_looting(&self)

Vanilla Mob.aiStep looting loop: while this mob may pick up loot and the mobGriefing game rule allows it, collect nearby dropped items in reach.
Source§

fn drop_custom_death_loot_mob( &self, _source: &DamageSource, killed_by_player: bool, )

Source§

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

Source§

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

Source§

fn set_death_loot_table(&self, loot_table: Option<Identifier>)

Source§

fn set_death_loot_table_seed(&self, seed: i64)

Source§

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

Source§

fn has_custom_death_loot_table(&self) -> bool

Source§

fn death_loot_table_seed(&self) -> i64

Source§

fn clear_custom_death_loot_table(&self)

Source§

fn is_within_home(&self) -> bool

Source§

fn is_within_home_pos(&self, pos: BlockPos) -> bool

Source§

fn is_within_home_vec(&self, pos: DVec3) -> bool

Source§

fn set_home_to(&self, position: BlockPos, radius: i32)

Source§

fn home_position(&self) -> BlockPos

Source§

fn home_radius(&self) -> i32

Source§

fn clear_home(&self)

Source§

fn has_home(&self) -> bool

Source§

fn check_mob_despawn(&self)

Source§

fn nearest_player_distance_sqr(&self) -> Option<f64>

Source§

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

Source§

fn get_pathfinding_malus(&self, path_type: PathType) -> f32

Source§

fn max_fall_distance(&self) -> i32

Blocks a mob can fall before taking fall damage; concrete mobs may raise this.
Source§

fn set_pathfinding_malus(&self, path_type: PathType, malus: f32)

Source§

fn is_no_ai(&self) -> bool

Source§

fn set_no_ai(&self, no_ai: bool)

Source§

fn is_left_handed(&self) -> bool

Source§

fn set_left_handed(&self, left_handed: bool)

Source§

fn is_aggressive(&self) -> bool

Source§

fn max_head_x_rot(&self) -> f32

Maximum degrees the head may pitch up or down independently of the body.
Source§

fn max_head_y_rot(&self) -> f32

Maximum degrees the head may yaw left or right independently of the body.
Source§

fn do_hurt_target( &self, entity: &SharedEntity, world: &World, target: &SharedEntity, ) -> bool

Performs this mob’s melee attack against target: computes weapon damage and knockback, applies enchantment effects, and returns whether the target was hurt.
Source§

fn mob_attack_damage_source( &self, weapon_item: &ItemStack, attacker: &SharedEntity, ) -> DamageSource

Builds the damage source for this mob’s melee attack: the weapon’s custom damage type if set, else its behavior’s item damage source, else the default mob-attack type.
Source§

fn get_attack_knockback( &self, target: &dyn Entity, weapon_item: &ItemStack, damage_source: &DamageSource, ) -> f64

Computes attack knockback strength from the attack-knockback attribute and the weapon’s knockback enchantments.
Source§

fn cause_extra_knockback( &self, target: &dyn Entity, knockback_amount: f64, _old_movement: DVec3, )

Knocks the target back in this mob’s facing direction and dampens this mob’s own horizontal velocity.
Source§

fn play_attack_sound(&self)

Plays this mob’s attack sound; does nothing by default.
Source§

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

Returns whether target is within this mob’s melee attack range.
Source§

fn attack_bounding_box(&self, horizontal_expansion: f64) -> WorldAabb

Returns the bounding box used for melee range checks, expanded horizontally and extended to cover a ridden vehicle.
Source§

fn set_aggressive(&self, aggressive: bool)

Source§

fn set_mob_flag(&self, flag: i8, enabled: bool)

Source§

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

Source§

fn set_wanted_position(&self, position: DVec3, speed_modifier: f64)

Source§

fn jump_control_jump(&self)

Source§

fn set_mob_speed(&self, speed: f32)

Mirrors vanilla Mob.setSpeed: update cached speed and forward AI input.
Source§

fn mob_server_ai_step(&self, entity: &SharedEntity)

Source§

fn is_sun_burn_tick(&self) -> bool

Rolls the daylight-burning chance when MONSTERS_BURN is enabled. Water, rain, and powder snow prevent burning.
Source§

fn sun_protection_slot(&self) -> EquipmentSlot

Source§

fn tick_daylight_burning(&self)

Damages sun-protective gear on a successful burn roll, or ignites the mob if the slot is empty.
Source§

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

Runs movement, daylight burning, and item pickup. Read more
Source§

fn tick_path_navigation(&self)

Source§

fn tick_move_control(&self)

Source§

fn tick_move_to_control(&self, wanted_position: DVec3, speed_modifier: f64)

Source§

fn tick_strafe_control(&self, forward: f32, right: f32)

Source§

fn is_strafe_walkable(&self, dx: f32, dz: f32) -> bool

Source§

fn tick_jumping_control(&self, speed_modifier: f64)

Source§

fn tick_look_control(&self)

Source§

fn clamp_head_rotation_to_body_when_pathing(&self)

Source§

fn tick_jump_control(&self)

Source§

fn update_control_flags(&self)

Source§

fn tick_body_rotation_control(&self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: ErasedType + ?Sized,

Source§

fn is<T>(&self) -> bool
where T: DowncastType,

Returns whether the erased value has concrete type T.
Source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: DowncastType,

Returns the erased value as T when its key matches.
Source§

fn downcast_mut<T>(&mut self) -> Option<&mut T>
where T: DowncastType,

Returns the erased value as mutable T when its key matches.
Source§

impl<T> EntityEventSource for T
where T: Entity,

Source§

fn into_shared_entity(self: Arc<T>) -> Arc<dyn Entity> ⓘ

Retains this exact entity allocation as a shared entity handle.
Source§

fn as_entity_event_source(&self) -> &(dyn Entity + 'static)

Returns this entity as a game-event source.
Source§

impl<T> ErasedType for T
where T: DowncastType,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoShared for T

Source§

fn into_shared(self) -> Arc<Mutex<RawMutex, Self>> ⓘ

Wraps this value in an Arc<SyncMutex<>>
Source§

impl<T> Leashable for T
where T: Mob,

Source§

fn can_be_leashed(&self) -> bool

Rejects enemies by default; concrete mobs may override the type-level rule.

Source§

fn leash_too_far_behaviour(&self)

Drops the leash and disables MOVE until re-leashed at close range.

Source§

fn leash_data(&self) -> &Mutex<RawMutex, Option<LeashData>>

Returns the shared leash data (if any).
Source§

fn on_leash_removed(&self)

Called by leash-drop paths after clearing leash data.
Source§

fn when_leashed_to(&self, holder: &(dyn Entity + 'static))

Called when this entity is leashed to holder.
Source§

fn close_range_leash_behaviour(&self, holder: &(dyn Entity + 'static))

Called every tick this leash is not elastic (pulling) or snappable.
Source§

fn is_leashed(&self) -> bool

Returns whether this entity is leashed.
Source§

fn may_be_leashed(&self) -> bool

Whether leash data exists, including pending save restoration. This follows vanilla’s mayBeLeashed; permission is Self::can_be_leashed.
Source§

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

Returns the entity holding this entity with a leash, if any.
Source§

fn leash_attachment(&self) -> Option<LeashAttachment>

Source§

fn set_delayed_leash_attachment(&self, attachment: LeashAttachment)

Source§

fn leash_distance_to(&self, holder: &dyn Entity) -> f64

Returns the distance between the bounding box’s center of the entity and that of holder. Read more
Source§

fn leash_snap_distance(&self) -> f64

Returns the minimum leash distance for which a leash will snap.
Source§

fn leash_elastic_distance(&self) -> f64

Returns the minimum leash distance for which a leash behaves elastically (it pulls the leashed entity towards the holder).
Source§

fn on_elastic_leash_pull(&self)

Called every tick this entity’s leash starts acting elastic (it pulls the leashed entity towards the holder).
Source§

fn check_elastic_interactions(&self, holder: &dyn Entity) -> bool

Performs the calculations to pull this entity towards its leash holder and applies velocity to it.
Source§

fn apply_leash_angular_momentum(&self) -> bool

Applies some angular momentum by the leash for rotation purposes.
Source§

fn rotate_by_leash_angular_momentum(&self, angular_momentum: f64)

Rotates this entity with the provided angular momentum value.
Source§

fn leash_angular_momentum(&self) -> Option<f64>

Returns the angular momentum experienced by this entity (if it is leashed).
Source§

fn leash_angular_friction(&self) -> f64

Returns the friction multiplier for calculating the angular momentum of a leash. Read more
Source§

fn can_have_a_leash_attached_to(&self, holder: &dyn Entity) -> bool

Returns whether this entity can have a leash attached to another.
Source§

fn set_leashed_to(&self, holder: &SharedEntity) -> bool

Sets this entity to be leashed to a holder, removing the old holder’s connection, if any.
Source§

fn restore_leash_from_save(&self)

Updates the delayed leash info to use the entity’s current context to resolve the entity’s actual leash connection (whether it be an external entity or a fence knot).
Source§

fn tick_leash(&self)

Ticks the leash holding this entity.
Source§

fn drop_leash(&self)

Breaks the leash and drops a lead item.
Source§

fn remove_leash(&self)

Removes the leash without dropping a lead item.
Source§

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

Clears leash data and returns the former holder without calling Self::on_leash_removed, preserving home state on failed save restoration.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more