pub struct MobBase {Show 16 fields
goal_selector: SyncMutex<GoalSelector>,
target_selector: SyncMutex<GoalSelector>,
target: SyncMutex<Option<WeakEntity>>,
sensing: SyncMutex<Sensing>,
controls: SyncMutex<MobControls>,
navigation: SyncMutex<PathNavigation>,
pathfinding_malus: SyncMutex<PathfindingMalus>,
persistence_required: SyncMutex<bool>,
can_pick_up_loot: SyncMutex<bool>,
drop_chances: SyncMutex<DropChances>,
home_restriction: SyncMutex<MobHomeRestriction>,
death_loot_table: SyncMutex<Option<Identifier>>,
death_loot_table_seed: SyncMutex<i64>,
leash_data: SyncMutex<Option<LeashData>>,
ambient_sound_time: SyncMutex<i32>,
xp_reward: SyncMutex<i32>,
}Fields§
§goal_selector: SyncMutex<GoalSelector>§target_selector: SyncMutex<GoalSelector>§target: SyncMutex<Option<WeakEntity>>§sensing: SyncMutex<Sensing>§controls: SyncMutex<MobControls>§pathfinding_malus: SyncMutex<PathfindingMalus>§persistence_required: SyncMutex<bool>§can_pick_up_loot: SyncMutex<bool>§drop_chances: SyncMutex<DropChances>§home_restriction: SyncMutex<MobHomeRestriction>§death_loot_table: SyncMutex<Option<Identifier>>§death_loot_table_seed: SyncMutex<i64>§leash_data: SyncMutex<Option<LeashData>>§ambient_sound_time: SyncMutex<i32>§xp_reward: SyncMutex<i32>Implementations§
Source§impl MobBase
impl MobBase
pub fn new() -> Self
pub const fn goal_selector(&self) -> &SyncMutex<GoalSelector>
pub const fn target_selector(&self) -> &SyncMutex<GoalSelector>
pub(crate) const fn sensing(&self) -> &SyncMutex<Sensing>
pub fn target( &self, is_valid: impl Fn(&dyn LivingEntity) -> bool, ) -> Option<SharedEntity>
pub fn set_target( &self, target: Option<&SharedEntity>, is_valid: impl Fn(&dyn LivingEntity) -> bool, ) -> bool
pub const fn controls(&self) -> &SyncMutex<MobControls>
pub const fn pathfinding_malus(&self) -> &SyncMutex<PathfindingMalus>
pub const fn persistence_required(&self) -> &SyncMutex<bool>
pub const fn can_pick_up_loot(&self) -> &SyncMutex<bool>
const fn drop_chances(&self) -> &SyncMutex<DropChances>
const fn home_restriction(&self) -> &SyncMutex<MobHomeRestriction>
const fn death_loot_table(&self) -> &SyncMutex<Option<Identifier>>
const fn death_loot_table_seed(&self) -> &SyncMutex<i64>
const fn leash_data(&self) -> &SyncMutex<Option<LeashData>>
pub fn ambient_sound_time(&self) -> i32
pub fn set_ambient_sound_time(&self, ambient_sound_time: i32)
fn get_and_increment_ambient_sound_time(&self) -> i32
pub fn xp_reward(&self) -> i32
pub fn set_xp_reward(&self, xp_reward: i32)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MobBase
impl !RefUnwindSafe for MobBase
impl !UnwindSafe for MobBase
impl Send for MobBase
impl Sync for MobBase
impl Unpin for MobBase
impl UnsafeUnpin for MobBase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreWraps this value in an
Arc<SyncMutex<>>