pub struct Entities { /* private fields */ }Expand description
The tracked entities and tab list (queries are the same for every version).
Implementations§
Source§impl Entities
impl Entities
Sourcepub fn get(&self, id: i32) -> Option<&Entity>
pub fn get(&self, id: i32) -> Option<&Entity>
The entity with this id (including the bot’s own entry, see Entities::self_id).
Sourcepub fn iter(&self) -> impl Iterator<Item = &Entity>
pub fn iter(&self) -> impl Iterator<Item = &Entity>
Other entities (the bot’s own entry is skipped), arbitrary order.
Sourcepub fn self_id(&self) -> Option<i32>
pub fn self_id(&self) -> Option<i32>
The bot’s own entity id (from login). Its entry carries metadata, effects, equipment
and riding state, but no position: the client owns its own position.
Sourcepub fn within(&self, p: [f64; 3], radius: f64) -> impl Iterator<Item = &Entity>
pub fn within(&self, p: [f64; 3], radius: f64) -> impl Iterator<Item = &Entity>
Entities whose server position is within radius of p (linear scan).
Sourcepub fn near(&self, p: [f64; 3], radius: f64) -> impl Iterator<Item = &Entity>
pub fn near(&self, p: [f64; 3], radius: f64) -> impl Iterator<Item = &Entity>
Alias of Entities::within.
Sourcepub fn player_info(&self, uuid: &Uuid) -> Option<&PlayerInfo>
pub fn player_info(&self, uuid: &Uuid) -> Option<&PlayerInfo>
The tab list.
Sourcepub fn players(&self) -> impl Iterator<Item = (&Uuid, &PlayerInfo)>
pub fn players(&self) -> impl Iterator<Item = (&Uuid, &PlayerInfo)>
All tab-list entries.
Sourcepub fn player_name(&self, id: i32) -> Option<&str>
pub fn player_name(&self, id: i32) -> Option<&str>
Name of a player entity (from the tab list).
Sourcepub fn drain_events(&mut self) -> Drain<'_, Event> ⓘ
pub fn drain_events(&mut self) -> Drain<'_, Event> ⓘ
Takes the queued events (keeps the buffer’s capacity).
Trait Implementations§
Auto Trait Implementations§
impl Forget for Entities
impl Freeze for Entities
impl RefUnwindSafe for Entities
impl Send for Entities
impl Sync for Entities
impl Unpin for Entities
impl UnsafeUnpin for Entities
impl UnwindSafe for Entities
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