bevy-ecs-components
Installation
SKILL.md
Bevy 0.19 — ECS Components
When to use this skill
- Defining a new
Componentfor game state. - Bundling components via
#[require(...)](the modern replacement for "bundles"). - Reacting to component lifecycle: spawning, despawning, inserting, removing.
- Observers — reacting to entity-targeted events with
On<E>. - Choosing storage: Table (default, fast iteration) vs SparseSet (fast add/remove).
Canonical pattern
use bevy::prelude::*;
// 1. Plain components.
#[derive(Component, Default)]
struct Health(f32);