Skip to main content

EntitiesHost

Trait EntitiesHost 

pub trait EntitiesHost {
    // Provided methods
    fn entity(&self, id: u32) -> Option<EntityRef> { ... }
    fn level(&self, dimension: &str) -> Option<LevelRef> { ... }
}
Expand description

The host’s methods both sides share of the entities area, implemented by the game and reached through Host.

Provided Methods§

fn entity(&self, id: u32) -> Option<EntityRef>

Side: both. The entity id (the id events carry) as a handle for the entity_* methods: None with no world open, or for no such entity in the level in place or among the server’s players. On a client (API @API:client_entity_refs@), any entity the server shows this window, this window’s own player included. API 373.

fn level(&self, dimension: &str) -> Option<LevelRef>

Side: both. The level dimension (minecraft:the_nether) as a handle: on a client, the level it shows, whatever the server calls it. None with no world open, or for a dimension the server hasn’t loaded. API 373.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§