Skip to main content

AgeableMob

Trait AgeableMob 

Source
pub trait AgeableMob: Mob {
Show 24 methods // Required methods fn ageable_base(&self) -> &AgeableMobBase; fn is_age_locked(&self) -> bool; fn set_age_locked(&self, age_locked: bool); fn set_synced_baby(&self, baby: bool); // Provided methods fn age_boundary_changed(&self, _baby: bool) { ... } fn get_baby_start_age(&self) -> i32 { ... } fn get_age(&self) -> i32 { ... } fn set_age(&self, age: i32) { ... } fn is_baby(&self) -> bool { ... } fn set_baby(&self, baby: bool) { ... } fn forced_age(&self) -> i32 { ... } fn set_forced_age(&self, forced_age: i32) { ... } fn forced_age_timer(&self) -> i32 { ... } fn set_forced_age_timer(&self, forced_age_timer: i32) { ... } fn age_lock_particle_timer(&self) -> i32 { ... } fn set_age_lock_particle_timer(&self, timer: i32) { ... } fn can_age_up(&self) -> bool { ... } fn get_speed_up_seconds_when_feeding(ticks_until_adult: i32) -> i32 where Self: Sized { ... } fn age_up(&self, seconds: i32, forced: bool) { ... } fn finalize_spawn_ageable_mob( &self, world: &Arc<World>, spawn_reason: EntitySpawnReason, group_data: Option<SpawnGroupData>, ) -> Option<SpawnGroupData> { ... } fn mob_interact_ageable( &self, player: &Player, hand: InteractionHand, ) -> InteractionResult { ... } fn tick_ageable_mob(&self) { ... } fn save_ageable_mob(&self, nbt: &mut NbtCompound) { ... } fn load_ageable_mob(&self, nbt: BorrowedNbtCompoundView<'_, '_>) { ... }
}
Expand description

Vanilla-shaped behavior shared by entities that extend AgeableMob.

Required Methods§

Source

fn ageable_base(&self) -> &AgeableMobBase

Returns shared ageable runtime state.

Source

fn is_age_locked(&self) -> bool

Returns the synchronized vanilla age-lock flag.

Source

fn set_age_locked(&self, age_locked: bool)

Sets the synchronized vanilla age-lock flag.

Source

fn set_synced_baby(&self, baby: bool)

Sets the synchronized baby flag.

Provided Methods§

Source

fn age_boundary_changed(&self, _baby: bool)

Hook called after the baby/adult boundary changes.

Source

fn get_baby_start_age(&self) -> i32

Returns vanilla AgeableMob.getBabyStartAge.

Source

fn get_age(&self) -> i32

Returns vanilla AgeableMob.age.

Source

fn set_age(&self, age: i32)

Sets vanilla AgeableMob.age and updates synchronized baby state.

Source

fn is_baby(&self) -> bool

Returns whether this ageable mob is a baby.

Source

fn set_baby(&self, baby: bool)

Sets the vanilla baby state using the AgeableMob start age.

Source

fn forced_age(&self) -> i32

Returns vanilla AgeableMob.forcedAge.

Source

fn set_forced_age(&self, forced_age: i32)

Sets vanilla AgeableMob.forcedAge.

Source

fn forced_age_timer(&self) -> i32

Returns vanilla AgeableMob.forcedAgeTimer.

Source

fn set_forced_age_timer(&self, forced_age_timer: i32)

Sets vanilla AgeableMob.forcedAgeTimer.

Source

fn age_lock_particle_timer(&self) -> i32

Returns vanilla AgeableMob.ageLockParticleTimer.

Source

fn set_age_lock_particle_timer(&self, timer: i32)

Sets vanilla AgeableMob.ageLockParticleTimer.

Source

fn can_age_up(&self) -> bool

Returns whether this mob can naturally age toward adulthood this tick.

Source

fn get_speed_up_seconds_when_feeding(ticks_until_adult: i32) -> i32
where Self: Sized,

Returns vanilla AgeableMob.getSpeedUpSecondsWhenFeeding.

Source

fn age_up(&self, seconds: i32, forced: bool)

Applies vanilla AgeableMob.ageUp.

Source

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

Runs vanilla AgeableMob.finalizeSpawn, then delegates to Mob.finalizeSpawn.

Source

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

Handles vanilla AgeableMob.mobInteract.

Source

fn tick_ageable_mob(&self)

Ticks vanilla age progression.

Source

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

Saves vanilla ageable mob fields.

Source

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

Loads vanilla ageable mob fields.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§