Struct mc_core::world::level::EntityStorage [−][src]
pub struct EntityStorage {
pub ecs: EcsWorld,
// some fields omitted
}Fields
ecs: EcsWorldThe ECS storing all entities in the level.
Implementations
pub unsafe fn spawn_entity_unchecked(
&mut self,
entity_type: &'static EntityType,
pos: EntityPos
) -> Entity
pub unsafe fn spawn_entity_unchecked(
&mut self,
entity_type: &'static EntityType,
pos: EntityPos
) -> Entity
Spawn an entity in the level owning this storage, you must give its type and position,
its handle is returned. If the given entity type is not supported by the level’s
environment, None is returned.
Safety:
This method is made for internal use because the entity type must be supported checked to be supported by level’s environment. The returned entity handle must also be added in the the associated chunk if existing.
See:
Use Level::spawn_entity instead of this method if you want to avoid safety issues.
Add a raw entity from a builder, this method is unsafe because the caller must ensure
that the builder contains a BaseEntity component with an entity
