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: the full one, or the names-only one of
Config::player_names).
Sourcepub fn tab_name(&self, uuid: &Uuid) -> Option<&str>
pub fn tab_name(&self, uuid: &Uuid) -> Option<&str>
Profile name of a tab-list entry (full list or names only).
Sourcepub fn tab_game_mode(&self, uuid: &Uuid) -> Option<i32>
pub fn tab_game_mode(&self, uuid: &Uuid) -> Option<i32>
Game mode of a tab-list entry (full list or names only).
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).